hasjem Posted May 12, 2010 Share Posted May 12, 2010 I have the following script: <script type="text/javascript" src="prototype.js"></script> <script> new Ajax.Request("test.php", { method: 'post', postBody: 'naam='+ $F('naam')+'&name='+$F('name'), onComplete: showResponse }); } function showResponse(req){ $('show').innerHTML= req.responseText; } </script> <form id="test" onsubmit="return false;"> <input type="hidden" name="name" id="name" value="<?echo$volgnummer;?>"> <input type="hidden" name="naam" id="naam" value="<?echo$naam;?>"> <input type='hidden'name='wachtwoord' id="wachtwoord" value="<?echo$wachtwoord;?>"> <input type="submit" value="bieden" onClick="sendRequest()"> </form> <div id="show"></div> and for checking the following phpfile <?php echo "you typed ".$_POST["naam"]; echo "you typed ".$_POST["name"]; ?> now the problem is this part: postBody: 'naam='+ $F('naam')+'&name='+$F('name'), it only sends the first parameter, "naam" and not the second. what should the postbody look like to show more then one parameter? thanx lex moen Quote Link to comment Share on other sites More sharing options...
trq Posted May 12, 2010 Share Posted May 12, 2010 I've not used prototype but I would assume you need a querystring. postBody: 'naam='+ $F('naam')+'&name='+$F('name'), Quote Link to comment Share on other sites More sharing options...
hasjem Posted May 12, 2010 Author Share Posted May 12, 2010 great, that solved it. thanx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.