Dear All,
I have a form use for uploading photos to my website. But I would like users to fully filled in the selection only then the "Submit" or "Upload" button will be activated. How can I do this?

Below is my code:

<form name=Image enctype=multipart/form-data method=POST>
<table cellspacing=2 cellpadding=2 border=0>
<tr>
<td>Image 1: </td>
<td><input type=file name=file accept=image/gif, image/jpeg, image/x-ms-bmp, image/x-png size=26 class=textbox />
</td>
</tr>

<tr>
<td>Image 2: </td>
<td><input type=file name=file1 accept=image/gif, image/jpeg, image/x-ms-bmp, image/x-png size=26 class=textbox />
</td>
</tr>

<tr>
<td>Image 3: </td>
<td><input type=file name=file2 accept=image/gif, image/jpeg, image/x-ms-bmp, image/x-png size=26 class=textbox />
</td>
</tr>

<tr><td> </td><td><input type=submit name=submit value=Upload class=button /></td></tr></table>
</form><br>

Thanks for any help.

You can use the 'required' html attribute by adding it to the necessary fields.
Or you can use a javascript function on the click event of the submit button to check all inputs and only if all pass validation does the function return true and let the submit continue.
Or you can still submit the form but use PHP code to check the passed parameters and either process the form or pass errors back to the page.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.