Jump to content

[SOLVED] getting dynamic form values


RIRedinPA

Recommended Posts

if i am using javascript to create and populate a form and then want another script to get the values of that form how would I go about doing it?

 

for example:

 


function makeform() { 

var theform = "<form name='form1'><textarea name='ta1' rows='10' cols='20'>This is the content</textarea><p><a href='javascript void(0);' onClick='getformvalues();'>Submit</a>";

document.getElementById('formholder').innerHTML = theform; 
document.getElementById('formholder')style.display = "block";

}

function getformvalues() { 
alert(document.getElementById('ta1').value); 
}

 

I get nothing in the alert and the error console shows document.getElementById('ta1') as being null.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/121717-solved-getting-dynamic-form-values/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.