Question use a dynamic input box and button to call a function

julrikson

New member
Joined
Oct 25, 2010
Messages
1
Programming Experience
1-3
Hi, I have been trying to figure out a way to make this happen for a while but not having much luck with searches and trial and error.

My goal is to create a message board where users can comment on a post without leaving the main page.

I am basically creating all the html code to display the current posts and comments in the vb code and running through a loop to select all the posts and comments from the database. I was able to add some code in the loops statement so that i could put a link on each post that links to a page to post a reply. <a href=postreply.aspx?postid=xxx>Comment</a>. When click that link on any post they get a new page with an input box and submit button that writes the comment to the db getting the parent postid from the querystring and then it goes back to main page and the comment shows. I am looking for a way so that under each post there will be a comment box with a submit button so they can just type there, click comment and it will show up.

I tried just creating asp input box and button in the loop and then have a sub for that button click but since I have to id them all the same it just doesn't show the buttons. My comment code is already a public function that I pass the postid, message text, and memberid into, is there anyway to call this function from a submit button where I don't have to give id's and can grab the text that is in the textbox?

Thanks and sorry if that is confusing, if i need to clear something up let me know.
 
Back
Top