i have an ajax for submit script on my html page, which loads a php script with form on it….
the form only has one input for a line of comments…. this is sent via post over ajax….
however i need to create a javascript function to link from onclick in a link….
the script will be embedded in the php form page (which already has js on it)
i have around 10 different images, and i need to be able to click on each image, and it will call the function..
<a id="image_1" href="javascript: void(0);" onClick="newFunction(this.id)"> image </a>
so that the function will be called when you click the image and will transfer the variable ID to the function…..
i need the function to GET the value of the form text box,
then add the
<a id=
to the end of the string of data that was in the text box (in this example the id would be
'image_1'
then write the new string ( form_data_in_textbox image_1 ) to the text box….
form name + id = myform
text box name + id = comments
this could be quite simple, but im not the best at javascript…. im learning though 🙂
if I got you right, this should be: