House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  Javascript

Need help with dynamic form fields

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
hello
Torrent Girl
05/30/09 08:48 P
Try something like this:
Maya Tulchinsky
05/31/09 02:58 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Torrent Girl
05/30/2009 08:48 PM

hello I have an issue that I am stuck on. I need to check the value of dynamic form fields with javascript and don't know how. Here is what the form fields look like: compensationType_userID (this is the field name) The userID will be the dynamic part. How do I check for the value in javascript on the form submission? "If compensation type = salary, then do this..." Thank you.

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Maya Tulchinsky
05/31/2009 02:58 PM

Try something like this: in javascript: varName =  "compensationType_" + userID; varFormField = document.getElementsByName(varName); now you can get value from varFormField.value. --- On Sat, 5/30/09, Torrent Girl <torrentgirl@gmail.com> wrote: From: Torrent Girl <torrentgirl@gmail.com> Subject: Need help with dynamic form fields To: "javascript" <js-jive@houseoffusion.com> Date: Saturday, May 30, 2009, 5:42 PM hello I have an issue that I am stuck on. I need to check the value of dynamic form fields with javascript and don't know how. Here is what the form fields look like: compensationType_userID (this is the field name) The userID will be the dynamic part. How do I check for the value in javascript on the form submission? "If compensation type = salary, then do this..." Thank you.


<< Previous Thread Today's Threads Next Thread >>

Search javascript

May 23, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference