943,708 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 11515
  • PHP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Sep 16th, 2009
0

Re: check box enable button

html Syntax (Toggle Plain Text)
  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.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Sep 16th, 2009
0

Re: check box enable button

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Dasjetta is offline Offline
6 posts
since Sep 2009
Sep 16th, 2009
0

Re: check box enable button

html Syntax (Toggle Plain Text)
  1. <input type='button' id='back' value='back' onclick='javascript: history.go(-1);' />
Last edited by almostbob; Sep 16th, 2009 at 11:10 pm.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Sep 16th, 2009
0

Re: check box enable button

Click to Expand / Collapse  Quote originally posted by almostbob ...
html Syntax (Toggle Plain Text)
  1. <input type='button' id='back' value='back' onclick='javascript: history.go(-1);' />
You guys ROCK! This is freaking awesome
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Dasjetta is offline Offline
6 posts
since Sep 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Need help
Next Thread in PHP Forum Timeline: Need Help in sending n receiving verification email





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC