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 Link to comment https://forums.phpfreaks.com/topic/201505-multiple-parameters-in-postbody/ 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'), Link to comment https://forums.phpfreaks.com/topic/201505-multiple-parameters-in-postbody/#findComment-1057160 Share on other sites More sharing options...
hasjem Posted May 12, 2010 Author Share Posted May 12, 2010 great, that solved it. thanx Link to comment https://forums.phpfreaks.com/topic/201505-multiple-parameters-in-postbody/#findComment-1057164 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.