Jump to content

multiple parameters in postbody


hasjem

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.