PDA

View Full Version : Ajax.Updater on checkbox elem not passing checkbox value to backend


mjb3677
06-19-2009, 05:06 PM
Hi all, I'm a n00b Ajax developer, so bear w/ me. I need some help with a script that should be fairly straightforward. I'm developing a form for internal QA that allows a user to check a checkbox confirming a particular test has been done, updating the database on the fly. I chose prototype because thats what we use in house, and while the call is working fine, the only parm that is not being sent is the checkbox value, for example:

<p>Have requirements been requested from the client?
<input type="checkbox" name="requirements" id="req" value="y"
onclick="new Ajax.Updater('testPlan', 'updateTestPlan.iphtml',
{ asynchronous:true, evalScripts:true,
parameters:'item=<% = $Q::item %>&amp;pm=<% = $env->{REMOTE_USER} %>'});"></p>

The value of "y" when the check box is checked or null when it's not checked is not being passed to the backend..what am I missing here?

We're using a perl framework on Apache::ASP for the backend, if that makes any diff.

tia for any help.

:confused:

ohgod
06-19-2009, 06:47 PM
well, where in
parameters:'item=<% = $Q::item %>&amp;pm=<% = $env->{REMOTE_USER} %>'
are you even trying to get the value of y?

mjb3677
06-19-2009, 06:51 PM
How can I do that in the parms string? I was under the impression that the value would be passed..no?

ohgod
06-22-2009, 01:29 PM
not unless you tell it to, or leave the parameter string blank (not 100% on the second part)

try
parameters:'item=<% = $Q::item %>&pm=<% = $env->{REMOTE_USER} %>&y='+$F('y')