Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Form Input Field Values 1

Status
Not open for further replies.

kennygadams

Programmer
Jan 2, 2005
94
US
Is there any way to use a variable in the Field Name area to get the value from the document?

I can get it to work if i use the actual field name of the form but not when I put the field name into a variable.

Code:
var counter;
counter++;

var fieldName = "";
fieldName = "caption_" + counter;

alert(document.write_to_database_form.fieldName.value);



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top