View Single Post

  #1 (permalink)  
Old 23-07-2008, 12:53 AM
Tom Tom is offline
Wannabe Geek
 
Join Date: Jan 2007
Location: Kildare, Ireland
Posts: 183
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Tom is a splendid one to beholdTom is a splendid one to beholdTom is a splendid one to beholdTom is a splendid one to beholdTom is a splendid one to beholdTom is a splendid one to beholdTom is a splendid one to behold
Default Javascript help needed

I'm trying to create some dynamic form fields using javascript. Basically the user enters some text in the new_option text field below and when they click the add_option button it adds a populated text field to a form that is already on the page. Anyone know how to do this off hand?

Code:
<input type="text" name="new_option"> <input type="button" name="add_option" value="Add Option" onClick="xxxx">

When button is pressed the new_options are outputed here as addtional text fields which can then be submitted with the main form.

Edit: I've come across an example at http://www.openjs.com/scripts/examples/addfield.php that comes close to what I'm trying to do. Seems like it should work for me, just need to re-write it a bit to suit my needs.
__________________
MGS Web Design - Web Design Kildare, Web Design Ireland

Last edited by Tom; 23-07-2008 at 02:12 AM.
Reply With Quote