Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 07-20-2009, 12:08 PM Mandatory Tick Box:
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 960
Name: Darren
Location: England
Trades: 0
Hi,

I have a contact form that email on submission, is there a way I can add something to my code to make the "terms & conditions" tick box mandatory so you HAVE to tick it before the submit button can be pressed?

Cheers
__________________
I Just a test to see what happens...
Please login or register to view this content. Registration is FREE

"Let us be thankful for the fools. But for them the rest of us could not succeed..."
rolda hayes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-20-2009, 01:24 PM Re: Mandatory Tick Box:
Novice Talker

Posts: 7
Name: Sofia
Trades: 0
Is that a question? or an anounce?
__________________
Sofi Hedz

Please login or register to view this content. Registration is FREE
Sofia22 is offline
Reply With Quote
View Public Profile Visit Sofia22's homepage!
 
Old 07-20-2009, 04:33 PM Re: Mandatory Tick Box:
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 960
Name: Darren
Location: England
Trades: 0
Well the fact that there is a "question mark" at the end of the sentance would point to a.. erm... question?

But in fairness, I DID forget to post the code so I'll let you off with that (unless your a bot...?)

Code:
<form name=terms form  method="POST" action="payment-text-link.php">
			    <table width="500" border="0" cellspacing="3" cellpadding="3">
                  <tr>
                    <td width="108">Name:</td>
                    <td width="392"><input type="text" name="Name" /></td>
                  </tr>
                  <tr>
                    <td>BusinessName:</td>
                    <td><input type="text" name="BusinessName" /></td>
                  </tr>
                  <tr>
                    <td>BusinessAddress:</td>
                    <td><textarea name="BusinessAddress" rows="5"></textarea></td>
                  </tr>
                  <tr>
                    <td>Telephone:</td>
                    <td><input type="text" name="Telephone" /></td>
                  </tr>
                  <tr>
                    <td>Email:</td>
                    <td><input type="text" name="Email" /></td>
                  </tr>
                  <tr>
                    <td>Website:</td>
                    <td><input type="text" name="Website" /></td>
                  </tr>
                  <tr>
                    <td>BusinessAdvert:</td>
                    <td><textarea name="BusinessAdvert" cols="50" rows="10"></textarea></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td><input type="checkbox" name="CHKBOX_1" value="yes"></p>
                    
                      <span class="style13">* I have read the terms &amp; conditions of buying this link
                      &nbsp;</span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td><input type="submit" name="submit" value="Continue To Payment Page" /></td>
                  </tr>
                </table>
__________________
I Just a test to see what happens...
Please login or register to view this content. Registration is FREE

"Let us be thankful for the fools. But for them the rest of us could not succeed..."
rolda hayes is offline
Reply With Quote
View Public Profile
 
Old 07-20-2009, 04:59 PM Re: Mandatory Tick Box:
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Here's a quick and dirty way to do it. I usually don't advocate inline scripts like this, but it will still teach you something:
HTML Code:
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" name="CHKBOX_1" value="yes" onclick="if(this.checked){document.getElementById('submit').disabled = false;}else{document.getElementById('submit').disabled = true;}"></p>

  <span class="style13">* I have read the terms &amp; conditions of buying this link
  &nbsp;</span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" id="submit" name="submit" value="Continue To Payment Page" disabled="disabled" /></td>
</tr>
Note that I put an id="submit" on your submit button, as well as making it disabled by default.
__________________
Join me on
Please login or register to view this content. Registration is FREE

Last edited by wayfarer07; 07-20-2009 at 05:00 PM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-20-2009, 05:16 PM Re: Mandatory Tick Box:
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 960
Name: Darren
Location: England
Trades: 0
Cheers Abel!

Thats solved it in an even better way than I thought it could be done!
__________________
I Just a test to see what happens...
Please login or register to view this content. Registration is FREE

"Let us be thankful for the fools. But for them the rest of us could not succeed..."
rolda hayes is offline
Reply With Quote
View Public Profile
 
Old 07-20-2009, 05:22 PM Re: Mandatory Tick Box:
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
If it's important legally for them to check the box, you may want to consider validating it on the server once it has been submitted, however, since JavaScript is client side stuff and could be bypassed.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Mandatory Tick Box:
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43868 seconds with 12 queries