This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Using Javascript for generating a form element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Using Javascript for generating a form element" Watch "Using Javascript for generating a form element" New topic
Author

Using Javascript for generating a form element

Ketan Joshi
Ranch Hand

Joined: Oct 09, 2005
Posts: 66
Hello All

I currently have a form which has one form field <input type='file'> to upload a file

I want to provide a button on the same page and if it is clicked, user should get another browse button to upload another file on the same page.

Is this possible using JavaScript or what is the best option where I can have multiple files uploaded

I dont want the page to be filled with browse boxes.They should be generated as per users choice when he clicks the button which has text "More files" on it.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

You can create them on-the-fly either through use of the innerHTML property, or by creating the DOM elements "by hand".
[ April 20, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Using Javascript for generating a form element