/    Sign up×
Community /Pin to ProfileBookmark

need help adding an ‘add comment’ form

I want to add an ‘add comment’ form to my website so users can post comments which update the html and display them.

So far I have the HTMLJavascript done, I am just confused how I would use the information from the form to create dynamic html. Here is the form i created:

[CODE]
<a href=”javascript:{ document.getElementById(‘addcomment’).style.display
= ‘block’; void(0); }”>add a comment</a>

<div style=”display: none;” id=”addcomment”>
<form class=”comment” method=”post”>
<label for=”comment_name”>name:</label>
<input name=”comment_name” size=”25″ value=”” type=”text”/>
<label for=”comment_comment”>comment:<br /></label>
</label><textarea name=”comment_comment” rows=”7″ cols=”30″></textarea><br/>
<input value=”post comment” type=”submit”/><br/></form></div>
[/CODE]

thanks

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 12.2007 — The information is saved on the server in a database or file, then the page is reloaded with the updated comments inserted.
Copy linkTweet thisAlerts:
@LuckY07authorNov 12.2007 — yeah, based on the code i showed i was curious how he had the form submitted. i am currently trying to use php, with the "action=comment.php" attribute inside the form. i then simply want to direct the writing to a .txt file.

my question is how did he submit his form, through what language? he doesn't have an action=" " inside his form. any ideas?
×

Success!

Help @LuckY07 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...