Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-08-2006, 08:29 PM   PM User | #1
Cheeseboy
Regular Coder

 
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Cheeseboy is an unknown quantity at this point
html button help needed?

hi, i want to have a button that says next and will only work if the checked box on top of it is checked. Does anyone know how to do this?
THanks
Cheeseboy is offline   Reply With Quote
Old 05-08-2006, 08:33 PM   PM User | #2
Beagle
Senior Coder

 
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
Beagle is an unknown quantity at this point
in the function that the next button calls, you can just check if the checkbox is checked:

Code:
<input type="button" onclick="func();" />

<script type="text/javascript">
function func()
{
  if (document.form1.buttonCheckbox.checked)
  {
    doWhatever;
  }
}
</script>
Beagle is offline   Reply With Quote
Old 05-08-2006, 08:43 PM   PM User | #3
Cheeseboy
Regular Coder

 
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Cheeseboy is an unknown quantity at this point
doesnt really make sense is this the whole code? or do you want me to right things in it?
Cheeseboy is offline   Reply With Quote
Old 05-08-2006, 09:24 PM   PM User | #4
Cheeseboy
Regular Coder

 
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Cheeseboy is an unknown quantity at this point
Ok, an example of it would be like the agree form we use here to register.
Cheeseboy is offline   Reply With Quote
Old 05-08-2006, 09:40 PM   PM User | #5
Beagle
Senior Coder

 
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
Beagle is an unknown quantity at this point
well, what does the button do?

A button that says next doesn't actually do anything when you click it. You have to tell it what to do.

So yes, you need to fill things in.
Beagle is offline   Reply With Quote
Old 05-08-2006, 09:58 PM   PM User | #6
Cheeseboy
Regular Coder

 
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Cheeseboy is an unknown quantity at this point
im am goign to list all my rules then, when you check in the box that you agree then you click a button called next which will take you to a different page. If you dont check the box and when you try to click next it i dont want it to work.
Cheeseboy is offline   Reply With Quote
Old 05-08-2006, 10:02 PM   PM User | #7
Beagle
Senior Coder

 
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
Beagle is an unknown quantity at this point
so where I have doWhatever, you put the code that the button is supposed to execute.
Beagle is offline   Reply With Quote
Old 05-08-2006, 10:44 PM   PM User | #8
Cheeseboy
Regular Coder

 
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Cheeseboy is an unknown quantity at this point
could you give me an example of the button code?
Cheeseboy is offline   Reply With Quote
Old 05-09-2006, 03:41 AM   PM User | #9
Beagle
Senior Coder

 
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
Beagle is an unknown quantity at this point
document.signupform.submit; ??

I mean, I don't know what you want to do. Submit a form? Calculate the total cost of the order form? Send an ajax call to validate their data? Do you see my dilemma? I have NO idea what you want beyond "the button not working unless the checkbox is checked". I got that for you, now you gotta make it work when the checkbox IS checked.
Beagle is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:55 AM.


Advertisement
Log in to turn off these ads.