Enjoy an ad free experience by logging in. Not a member yet?
Register .
05-08-2006, 08:29 PM
PM User |
#1
Regular Coder
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
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
05-08-2006, 08:33 PM
PM User |
#2
Senior Coder
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
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>
05-08-2006, 08:43 PM
PM User |
#3
Regular Coder
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
doesnt really make sense is this the whole code? or do you want me to right things in it?
05-08-2006, 09:24 PM
PM User |
#4
Regular Coder
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, an example of it would be like the agree form we use here to register.
05-08-2006, 09:40 PM
PM User |
#5
Senior Coder
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
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.
05-08-2006, 09:58 PM
PM User |
#6
Regular Coder
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
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.
05-08-2006, 10:02 PM
PM User |
#7
Senior Coder
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
so where I have doWhatever, you put the code that the button is supposed to execute.
05-08-2006, 10:44 PM
PM User |
#8
Regular Coder
Join Date: Mar 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
could you give me an example of the button code?
05-09-2006, 03:41 AM
PM User |
#9
Senior Coder
Join Date: Jul 2005
Location: New York, NY
Posts: 1,084
Thanks: 4
Thanked 19 Times in 19 Posts
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.
Jump To Top of Thread
Thread Tools
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
HTML code is Off
All times are GMT +1. The time now is 09:55 AM .
Advertisement
Log in to turn off these ads.