JavaScript related questions should go here.
matthijs110
Posts: 10 Joined: Sat Jun 08, 2013 11:17 am
Post
by matthijs110 » Mon Jun 17, 2013 5:50 pm
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:
<input name="notify_url" value="http://blizzardcraft.com/donation_callback.php " type="hidden">
How can i make this either. I am not very good in php.
(I dont ask if someone can make it for me)
Matt
ExtremeGaming
Posts: 205 Joined: Mon Jul 09, 2012 11:13 pm
Post
by ExtremeGaming » Mon Jun 17, 2013 7:41 pm
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.
if(document.getElementsByName("notify_url") === false) {
alert("Not checked");
} else {
// Checked
}
<?php while(!$succeed = try()); ?>
FrederickGeek8
Posts: 148 Joined: Wed Nov 30, 2011 10:31 pm
Post
by FrederickGeek8 » Sat Jun 22, 2013 9:03 pm
You would put either in the <head> wrapped in <script> tags or below all of your website contents (right before </body>)
matthijs110
Posts: 10 Joined: Sat Jun 08, 2013 11:17 am
Post
by matthijs110 » Sun Jun 23, 2013 5:28 am
And then i get an popup when my checkbox is not checked? And my donate button isn't clickable without having the checkbox checked?
Temor
Posts: 1186 Joined: Thu May 05, 2011 8:04 pm
Post
by Temor » Sun Jun 23, 2013 12:29 pm
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...
matthijs110
Posts: 10 Joined: Sat Jun 08, 2013 11:17 am
Post
by matthijs110 » Sun Jun 23, 2013 2:14 pm
I can still click on the button without having the checkbox checked.
Temor
Posts: 1186 Joined: Thu May 05, 2011 8:04 pm
Post
by Temor » Sun Jun 23, 2013 5:06 pm
Please read my previous post again.
Temor
Posts: 1186 Joined: Thu May 05, 2011 8:04 pm
Post
by Temor » Sun Jun 23, 2013 5:29 pm
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.
matthijs110
Posts: 10 Joined: Sat Jun 08, 2013 11:17 am
Post
by matthijs110 » Sun Jun 23, 2013 5:57 pm
I tryed everything.
It just wont work