I'm working on a website which requires ALL fields to be filled before a user can download stuff.

How can i code the web form as such a user has to fill in their details before the download button becomes active or usable?

Help greatly appreciated.


Well if you want to do this in PHP its very simple...

<form action="downloads.php" method="POST" enctype="text/data">
<input type="text" name="Field1NAME" placeholder="First Name"/>

<input type="submit" name="SubmitForm" value="Continue"/>



if(empty($_POST['Field1NAME'])){echo 'Please fill in your name.'; die;}

//continue with whatever code you use for the form inputs, remember to use mysql_real_escape_string($_POST['Field1NAME']); if you are using database.


If you want this with a javascript/jQuery effect, you should post in the JavaScript forum here on daniweb, or read some at the jQuery API.

Im no PHP wizard, but lets wait and see if ardav replies to you. He always gives you the correct answers