Question
Loop and set variables to pass
Hello All,
In the form I loop over a query and create a checkbox for each batch id, but the checkbox name is of course the same for each.
Then I have a button that does on "onclick" and calls my function.
<script language="javascript">
function thisBatch(url)
{
//alert(url);
location.href = url;
}
</script>
Here's how I've got the checkbox set:
<input type="checkbox" name="status" value="#batch_id#">
Then the "Submit" button:
<input type="submit" name="submitBatch" value="BATCH REQUESTS" onClick="thisBatch('#client.root#/batch_application.cfm?batch_ticket=1'); return false" />
I've tried to add document.forms.status.value to the "onClick" function, as well as setting a "var" within the javascript. I'm just not able to grab multiple checkbox values and pass them. Also, I'm not sure why, but this section I'm developing in is Fusebox 4 and my debugging doesn't even show any form variables being passed? So, it appears as if I need to set it in the URL to pass correctly.
If anyone has a really good example, I would greatly aprreciate it!
Kiamber
In the form I loop over a query and create a checkbox for each batch id, but the checkbox name is of course the same for each.
Then I have a button that does on "onclick" and calls my function.
<script language="javascript">
function thisBatch(url)
{
//alert(url);
location.href = url;
}
</script>
Here's how I've got the checkbox set:
<input type="checkbox" name="status" value="#batch_id#">
Then the "Submit" button:
<input type="submit" name="submitBatch" value="BATCH REQUESTS" onClick="thisBatch('#client.root#/batch_application.cfm?batch_ticket=1'); return false" />
I've tried to add document.forms.status.value to the "onClick" function, as well as setting a "var" within the javascript. I'm just not able to grab multiple checkbox values and pass them. Also, I'm not sure why, but this section I'm developing in is Fusebox 4 and my debugging doesn't even show any form variables being passed? So, it appears as if I need to set it in the URL to pass correctly.
If anyone has a really good example, I would greatly aprreciate it!
Kiamber