Hello,

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.

regards,
Pabbzmike

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"/>
</form>

downloads.php

<?php
session_start();error_reporting(E_ALL);

if(isset($_POST['SubmitForm'])){
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

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.