check box enable button

Reply

Join Date: Jan 2009
Posts: 1,365
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 164
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: check box enable button

 
0
  #11
Sep 16th, 2009
  1. <script type="text/javascript">
  2. function enableButton() {
  3. if(document.getElementById('option').checked='checked'){ document.getElementById('b1').disabled=""; }
  4. else { document.getElementById('b1').disabled='disabled'; }
  5. }
  6. </script>
  7. <p style='text-align:center;'>
  8. <span style='float:right;text-align:right;'>
  9. <input type="checkbox" name="option" id="option" onclick="javascript:enableButton();">
  10. <label for='option'>
  11. I have read and agree to the<br />terms and conditions
  12. </label>
  13. </span>
  14. <input type="button" name="b1" value="Click" id="b1" disabled='disabled' onclick="top.location.replace('http://www.google.com');" />
  15. </p>
Last edited by almostbob; Sep 16th, 2009 at 9:37 am.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 6
Reputation: Dasjetta is an unknown quantity at this point 
Solved Threads: 0
Dasjetta Dasjetta is offline Offline
Newbie Poster

Re: check box enable button

 
0
  #12
Sep 16th, 2009
Thanks guys for all the help. I was able to take cues from both of you to get what I wanted. I couldn't have done this without you. To see it in action go to http://www.holiday-scooters.com/HSR/...hair_Info.html

Now for one last question. Is it possible to add a "BACK" button to the left of the "ORDER" button to serve as a browser back button? It would make my site look better.

<script type="text/javascript">
function enableButton() {
if(document.getElementById('option').checked){
document.getElementById('b1').disabled='';
} else {
document.getElementById('b1').disabled='true';
}
}
</script>
<font size=-1 face="Verdana">
<p style='text-align:center;'>
<span style='float:left;text-align:right;'>
<input type="checkbox" name="option" id="option" onclick="javascript:enableButton();">
<label for='option'>I have read and agree to the<br />
</label>
</span>
<center><a href="http://www.holiday-scooters.com/HSR/Reservations.html">Terms & Conditions</a><br />
<br>
<input type="button" name="b1" value="ORDER" id="b1" disabled='disabled' onclick="top.location.replace('http://www.holiday-scooters.com/HSR/Booking_Agent.html');" />
<br />
</font>
</p>
Last edited by Dasjetta; Sep 16th, 2009 at 8:53 pm.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,365
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 164
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: check box enable button

 
0
  #13
Sep 16th, 2009
  1. <input type='button' id='back' value='back' onclick='javascript: history.go(-1);' />
Last edited by almostbob; Sep 16th, 2009 at 11:10 pm.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 6
Reputation: Dasjetta is an unknown quantity at this point 
Solved Threads: 0
Dasjetta Dasjetta is offline Offline
Newbie Poster

Re: check box enable button

 
0
  #14
Sep 16th, 2009
Originally Posted by almostbob View Post
  1. <input type='button' id='back' value='back' onclick='javascript: history.go(-1);' />
You guys ROCK! This is freaking awesome
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC