Terms & Conditions Page on Website

Associate
Joined
15 Nov 2005
Posts
1,389
Location
Peterborough
Hope someone can help!

I am designing a website for my brother-inlaw. He has asked for an enquiry form which is no problem but he only wants his clients to be able to send off the enquiry once they have 'agreed' to the terms and conditions.

I need the enquiry form to confirm that the client has clicked on the 'Agree' button in the t&C page and the 'Send' button be disabled until they have clicked on agree.

Preferably the t&c will be on a separate page.

Any help/pointers would be appreciated.
 
It is most common to have the terms and conditions within the form and just have them in a text area the scrolls so they only take up a small space.


You can then just have 2 simple radio buttons - agree to terms and conditions -yes/no.


You can then check on the server side for that being yes - if it is - then continue - if not then go back to the form and say - oi!

Very simple really.


If you really want the submit button to be unavailable until they tick 'yes' then this will require more work and involve JavaScript - you will still have to do the validation on the server side any way so I wouldn’t bother if you're not too confident.
 
Bloo_Fish said:
It is most common to have the terms and conditions within the form and just have them in a text area the scrolls so they only take up a small space.


You can then just have 2 simple radio buttons - agree to terms and conditions -yes/no.


You can then check on the server side for that being yes - if it is - then continue - if not then go back to the form and say - oi!

Very simple really.


If you really want the submit button to be unavailable until they tick 'yes' then this will require more work and involve JavaScript - you will still have to do the validation on the server side any way so I wouldn’t bother if you're not too confident.

Hi thanks for your reply.

I'm not a coder, can you give me an idea where to start with the radio button check (your first option) and I will go from there! :)
 
Bassicly, just make a form

and have something like

Code:
<p>Do you accept our <a href="tnc.html" title="terms and conditions">terms and conditions</a></p>

<input type="radio" name="tnc" value="yes" id="yes" />
<label for="yes">yes</label>

<input type="radio" name="tnc" value="no" id="no" />
<label for="no">no</label>


then on the server side something like (assuming php is your language of choice)

PHP:
<?php

if ( isset($_POST['submit']) ) {
  if ( $_POST['tnc'] == 'yes') {
    // Continue
  }else {
    // error
  }
}

?>
 
Bloo_Fish said:
then on the server side something like (assuming php is your language of choice)

I know my webhost has php so will be using that.

This may sound noobish. Where do I put the php script/code? Does the HTML not call the code? Never used php before - never really had use for it!

Thanks for your help so far :D
 
If you don't know PHP and only want to use it for this little bit you may be better off just using a bit of Javascript that disables the button until the box has been ticked. You can probably google for the JS.

If you were storing the form in a database then you may as well use PHP as it would be easy to include it with your validation.
 
punky_munky said:
If you don't know PHP and only want to use it for this little bit you may be better off just using a bit of Javascript that disables the button until the box has been ticked. You can probably google for the JS.

If you were storing the form in a database then you may as well use PHP as it would be easy to include it with your validation.

The problem with JavaScript is that its a 'nice to have' but cannot be relied upon for anything. If people can manually turn it off, then you have no control over people overriding your JavaScript validation.





AndyBorzi said:
I know my webhost has php so will be using that.

This may sound noobish. Where do I put the php script/code? Does the HTML not call the code? Never used php before - never really had use for it!

Thanks for your help so far :D


Right, you want to make an HTML file with a form inside it, then use the radio buttons code i posted above. For instructions in using forms look @ http://www.w3schools.com/html/html_forms.asp


Then you will set the forms action="form.php", then create a file called form.php and put the PHP code in there. And as you have never used PHP before, get yourself over to -> http://www.php.net/
 
Bloo_Fish said:
Right, you want to make an HTML file with a form inside it, then use the radio buttons code i posted above. For instructions in using forms look @ http://www.w3schools.com/html/html_forms.asp


Then you will set the forms action="form.php", then create a file called form.php and put the PHP code in there. And as you have never used PHP before, get yourself over to -> http://www.php.net/

I have already created a client enquiry form which submits the data via email using the /cgi-bin/mailer action. From your solution above you are using the form action="form.php" - can I have 2 form actions on the same page or will I have to create a separate page? I think it will look tidier on the same page but will go for 2 for ease!!

Thanks
 
Back
Top Bottom