Reply
 
Thread Tools
Old 03-17-2012, 06:30 AM   #1
shakemelikeapig
TFF Newbie
shakemelikeapig is on a distinguished road
 
Join Date: Mar 2012
Posts: 4
iTrader: (0)

Default comment posting feature in my site


I am trying to create a comments posting feature in my site using javascript
However everytime i click on submit it shows the comment posted for a second and then the comment dissapears. It does not retain the comment posted. Please help.

code is given below:

Code:
<html>
    <head>
        <script type="text/javascript">
            function post(){
                document.getElementById("label").innerHTML=document.hello.posted.value;
                              
            }
            
        </script>
    </head>
    <body>
        <form name="hello">
            <div id="label"> </div>
        <textarea name="posted">  </textarea>
        <input type="submit" value="Submit" onclick="post()">
        </form>
    </body>
</html>
CF
shakemelikeapig is offline   Reply With Quote

Old 04-16-2012, 11:25 AM   #2
alen12345
TFF Acquaintance
alen12345 is on a distinguished road
 
Join Date: Feb 2012
Posts: 88
iTrader: (0)


When you click on a submit button the page is refreshed, and reloaded once more. Change the type to "button". But I expect that you realise that only the writer of the comment can see it! If you want all you users to see the comments then you will require server-side scripting and a database.
alen12345 is offline   Reply With Quote
Old 05-17-2012, 01:42 PM   #3
SelinaWang
TFF Newbie
SelinaWang is on a distinguished road
 
Join Date: May 2012
Posts: 1
iTrader: (0)


nice posts cool
SelinaWang is offline   Reply With Quote
Old 06-04-2012, 05:44 AM   #4
Robbin07
TFF Acquaintance
Robbin07 is on a distinguished road
 
Join Date: Jun 2012
Posts: 47
iTrader: (0)


I think you need for visiting the website of w3school where your solution can be get easily.
Robbin07 is offline   Reply With Quote
Old 06-04-2012, 09:55 PM   #5
bhatti420
TFF Newbie
bhatti420 is on a distinguished road
 
Join Date: Jun 2012
Posts: 9
iTrader: (0)


from w3school you can get easily the script you want. All main scripts are available there.
bhatti420 is offline   Reply With Quote
Old 07-26-2012, 08:13 AM   #6
joelsculley
TFF Newbie
joelsculley is on a distinguished road
 
Join Date: Jul 2012
Posts: 2
iTrader: (0)


yes i am agree with you. Good information thanks
joelsculley is offline   Reply With Quote
Reply

Bookmarks

Tags
comment, feature, posting, site

Thread Tools

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New feature: Twitter crumblepie Latest News 12 07-31-2014 05:07 PM
New: Buy Me A Latte Feature crumblepie Latest News 3 12-02-2013 07:52 AM
New feature: Portfolio link under your avatar crumblepie Latest News 7 12-01-2013 10:43 PM
Ping Posting in SEO mobileapplover General 2 03-10-2012 07:35 AM
How to find do follow blog comment sites? gideonscott Web Developer 6 10-12-2011 07:53 PM

Forum Sponsors

Please take the time to visit the websites of some of our sponsors.