Jump to content

javascript function to show extra form fields


wrathican

Recommended Posts

hey people.

 

i have very limited knowledge of JS and what i have at the moment is an image upload form.

 

i want to change this single image upload to a multiple image upload.

 

in the form i have three 'box's'. i have a text input, file input and a textarea.

the two inputs cannot be empty but the textarea can be.

 

what i want to happen is that when the file input has been filled and the other input i want another set of these three 'box's' to be displayed. but i only want this to happen a maximum of five times so only five files are to be uploaded.

 

i can check the form once but then i have no idea what to do/how to it next.

 

so far i have gotten this far:

function displayFields()
{
var name=form.name.value;
var file=form.pic.value
if ((name!="") && (file!=""))
//i guess i show the extra fields here?
}
</script>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.