I am just a newbie to javascript, but the most stuff i do is in php or .net.
But, now i have 2 buttons on my script that are calling a javascript function as shown below (OnClick"").
Now after a person pushes 1 of the 2 buttons, i want to send some information to a php-file to update my database.
The only thing that the customer will see is a message from the alert( "Thanks");
for example.
This is what i did now:
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- var Counter = 0;
- function ConfirmPo( value, id ){
- if( Counter == 0){
- if( value == true ){
- document.location.href = 'http://www.adres.nl/update.php?accept=true&ip=11.11.11.11&id=20';
- alert("Thanks! The repairing will be carried out." );
- Counter++;
- }else if( value == false ){
- document.location.href = 'http://www.adres.nl/update.php?accept=false&ip=11.11.11.11&id=20';
- alert("Thanks! the repair will not be done.");
- Counter++;
- }
- }else{
- alert("Sorry, you already have made a choice..");
- }
- }
- </script>
After that it is not possible to change the option he/she made.
But that is working fine.
Is it possible to send some vars to my php script without opening a new window?
Thanks!
Paul