|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am curious to know if there is a way to combine values from two drop down options (Month and Year) as on CC form, into one variable prior to the form being submitted.
I generate my drop down options prior initiating the form like this: // Month Selector for ($x=1;$x<=12;$x++) { if ($x<=9) { $a="0".$x; } else { $a=$x; } $values_a.="<option value='$a'>$a</option>"; } // Year Selector for ($y=7;$y<=20;$y++) { if ($y<=9) { $b="200".$y; } else { $b="20".$y; } $values_b.="<option value='$b'>$b</option>"; } echo "<form method=post And display them on the form like this: <tr> <td> Expiration date </td> <td> <select name=varExpDate>$values_a</select><select name=varExpDate>$values_b</select> </td> </tr> So I need to combine both of them into one variable before sending it off for processing. Any help would be appreciated. Thanks
__________________
Rob |
|
|||
|
You can use JavaScript to combine the values and store them in a hidden field.
However if the user doesn't have JavaScript enabled then the value won't be combined, mind neither would the options be generated. It's far better to do everything server side that matters. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question on passing values into a sql statement from a form? | jpdeveloper | Database Discussion Forum | 15 | 02-15-2006 10:53 AM |
| ASP-form passing parameter values into another file?? | jpdeveloper | Web Programming Discussion Forum | 3 | 02-07-2006 06:06 PM |
| multiple values from form in php | Jerry | Web Programming Discussion Forum | 3 | 09-20-2005 03:34 PM |
| Reading & Posting HTML form values in PHP | jrobin747 | Web Programming Discussion Forum | 0 | 03-11-2005 10:02 AM |
| php form submission | wclew | Web Programming Discussion Forum | 12 | 11-12-2003 05:11 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |