[FX.php List] sending more than one field with lajax

Alex Gates alex at gandrpublishing.com
Wed Jan 24 14:38:01 MST 2007


Hi everyone-

I realize this is off topic, but I figured someone here may have some
experience with this.

I'm trying Lance Hallberg's LAJAX class.  I'm able to get it to work
with his example, but I am having trouble figuring out the right syntax
to send multiple fields in the POST.

On the website he says "NOTE: Params should be
name=value[&name2=value2...] format."

I haven't been able to get this.  

Would anyone like to help out a beginner and show me the proper syntax?

My code using:

<a
href="javascript:LAJAX.post(url,updatePost,'Recipes='+document.form1['nu
mberRecipes'].value)">Load Post Data</a><br />
<form name="form1" id="form1">
	<input type="text" id="numberRecipes" name="numberRecipes" />
	<input type="text" id="numberBooks" name="numberBooks" /> 
</form>

works just fine to send the first field, but I can't figure out how to
add the second field to the post array.
I've tried all sorts of combinations, but my little experience with
Javascript isn't helping me at all.

I thought this could do it:
<a
href="javascript:LAJAX.post(url,updatePost,'Recipes='+document.form1['nu
mberRecipes'].value , 'Books='+document.form1['numberBooks'].value
)">Load Post Data</a><

but I was wrong.

Any help would be much appreciated.

-Alex




More information about the FX.php_List mailing list