Checkbox required
-
- Posts: 10
- Joined: Sat Jun 08, 2013 11:17 am
Checkbox required
hi,
There is a website http://blizzardcraft.com/donations/.
There is a butten and a checkbox.
When i click on the Button (donate) without checking the checkbox, i get a pop-up screen.
when i click on the Button (donate) and have clicked on the checkbox, i will be redirected.
i found this line in the source code of the Donate button:
[syntax=xhtml]<input name="notify_url" value="http://blizzardcraft.com/donation_callback.php" type="hidden">[/syntax]
How can i make this either. I am not very good in php.
(I dont ask if someone can make it for me)
Matt
There is a website http://blizzardcraft.com/donations/.
There is a butten and a checkbox.
When i click on the Button (donate) without checking the checkbox, i get a pop-up screen.
when i click on the Button (donate) and have clicked on the checkbox, i will be redirected.
i found this line in the source code of the Donate button:
[syntax=xhtml]<input name="notify_url" value="http://blizzardcraft.com/donation_callback.php" type="hidden">[/syntax]
How can i make this either. I am not very good in php.
(I dont ask if someone can make it for me)
Matt
-
- Posts: 205
- Joined: Mon Jul 09, 2012 11:13 pm
Re: Checkbox required
This would be done with JavaScript, not PHP. However, you will need to validate it server side either way due to users that might have JavaScript disabled.
You can try this with JavaScript. Of course, you're going to need to incorporate it into your code so that the submission returns false if not checked.
[syntax=javascript]
if(document.getElementsByName("notify_url") === false) {
alert("Not checked");
} else {
// Checked
}[/syntax]
You can try this with JavaScript. Of course, you're going to need to incorporate it into your code so that the submission returns false if not checked.
[syntax=javascript]
if(document.getElementsByName("notify_url") === false) {
alert("Not checked");
} else {
// Checked
}[/syntax]
<?php while(!$succeed = try()); ?>
-
- Posts: 10
- Joined: Sat Jun 08, 2013 11:17 am
Re: Checkbox required
So where do i put it?
- FrederickGeek8
- Posts: 148
- Joined: Wed Nov 30, 2011 10:31 pm
Re: Checkbox required
You would put either in the <head> wrapped in <script> tags or below all of your website contents (right before </body>)
-
- Posts: 10
- Joined: Sat Jun 08, 2013 11:17 am
Re: Checkbox required
And then i get an popup when my checkbox is not checked? And my donate button isn't clickable without having the checkbox checked?
Re: Checkbox required
matthijs110 wrote:And then i get an popup when my checkbox is not checked? And my donate button isn't clickable without having the checkbox checked?
ExtremeGaming wrote:Of course, you're going to need to incorporate it into your code so that the submission returns false if not checked.
You can't just blatantly copy & paste and expect it to work...
-
- Posts: 10
- Joined: Sat Jun 08, 2013 11:17 am
Re: Checkbox required
I can still click on the button without having the checkbox checked.
Re: Checkbox required
Please read my previous post again.
-
- Posts: 10
- Joined: Sat Jun 08, 2013 11:17 am
Re: Checkbox required
Srry, but i just cant follow it
Re: Checkbox required
That's because you're expecting to just copy & paste for it to work without doing any work yourself.
Ask for help on how to fix this and you'll get help.
Ask to get this done for you and you will be ignored.
Try yourself before asking and it will be much more satisfying to you when it finally does work.
Ask for help on how to fix this and you'll get help.
Ask to get this done for you and you will be ignored.
Try yourself before asking and it will be much more satisfying to you when it finally does work.
-
- Posts: 10
- Joined: Sat Jun 08, 2013 11:17 am
Re: Checkbox required
I tryed everything.
It just wont work
It just wont work