By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

Checkbox Issues

P: n/a
Hello,

I have the following problem with the checkbox. The issue seems to be
that when I click on the following checkbox:

<input type= checkbox id="checkbox1" name="<%response.Write "recount"
& CoCount%>" value="<%=idx%>" >

with the following values below:

<input type=hidden name="recount" value=<%=idx%>>
<input type=hidden name="contactname"
value="<%=oDodgeCos3("f_person") %>" id=hidden1>
<input type=hidden name="drnum" value="<%=request("dr_num")%>"
id=hidden2>
<input type=hidden name="companyname"
value="<%=oDodgeCos3("f_comp_name")%>" id = hidden3>
<input type=hidden name="address"
value="<%=oDodgeCos3("f_addr1")%>" id=hidden4>
<input type=hidden name="city"
value="<%=oDodgeCos3("f_city")%>" id=hidden5>
<input type=hidden name="state"
value="<%=oDodgeCos3("f_state")%>" id=hidden6>
<input type=hidden name="zip" value="<%=oDodgeCos3("f_zip")%>"
id=hidden7>
<input type=hidden name="phone"
value="<%=oDodgeCos3("f_phone")%>" id=hidden8>
<input type=hidden name="fax"
value="<%=oDodgeCos3("f_fax_nbr")%>" id=hidden9>
The problem is that when I click on the box, it seems that the all
values is being passed over to the next page.

How would I have the values passed over based upon the checkbox that
the user select?

Thanks!
Kevin Davis

May 8 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

Kevin Davis wrote:
Hello,

I have the following problem with the checkbox. The issue seems to be
that when I click on the following checkbox:

<input type= checkbox id="checkbox1" name="<%response.Write "recount"
& CoCount%>" value="<%=idx%>" >

with the following values below:

<input type=hidden name="recount" value=<%=idx%>>
<input type=hidden name="contactname"
value="<%=oDodgeCos3("f_person") %>" id=hidden1>
<input type=hidden name="drnum" value="<%=request("dr_num")%>"
id=hidden2>
<input type=hidden name="companyname"
value="<%=oDodgeCos3("f_comp_name")%>" id = hidden3>
<input type=hidden name="address"
value="<%=oDodgeCos3("f_addr1")%>" id=hidden4>
<input type=hidden name="city"
value="<%=oDodgeCos3("f_city")%>" id=hidden5>
<input type=hidden name="state"
value="<%=oDodgeCos3("f_state")%>" id=hidden6>
<input type=hidden name="zip" value="<%=oDodgeCos3("f_zip")%>"
id=hidden7>
<input type=hidden name="phone"
value="<%=oDodgeCos3("f_phone")%>" id=hidden8>
<input type=hidden name="fax"
value="<%=oDodgeCos3("f_fax_nbr")%>" id=hidden9>
The problem is that when I click on the box, it seems that the all
values is being passed over to the next page.

How would I have the values passed over based upon the checkbox that
the user select?

Thanks!
Kevin Davis


What does your second page do? Your requirement isn't entirely clear.

--
Mike Brind

May 10 '06 #2

P: n/a
Basically on the next page there is a form that stores the information
based upon the information. For example, I would click on both records
and I would only like to see the first record first then the next
record an so on. Basically the second page allows the user to modify
the data.

May 10 '06 #3

P: n/a

Kevin Davis wrote:
Hello,

I have the following problem with the checkbox. The issue seems to be
that when I click on the following checkbox:

<input type= checkbox id="checkbox1" name="<%response.Write "recount"
& CoCount%>" value="<%=idx%>" >

with the following values below:

<input type=hidden name="recount" value=<%=idx%>>
<input type=hidden name="contactname"
value="<%=oDodgeCos3("f_person") %>" id=hidden1>
<input type=hidden name="drnum" value="<%=request("dr_num")%>"
id=hidden2>
<input type=hidden name="companyname"
value="<%=oDodgeCos3("f_comp_name")%>" id = hidden3>
<input type=hidden name="address"
value="<%=oDodgeCos3("f_addr1")%>" id=hidden4>
<input type=hidden name="city"
value="<%=oDodgeCos3("f_city")%>" id=hidden5>
<input type=hidden name="state"
value="<%=oDodgeCos3("f_state")%>" id=hidden6>
<input type=hidden name="zip" value="<%=oDodgeCos3("f_zip")%>"
id=hidden7>
<input type=hidden name="phone"
value="<%=oDodgeCos3("f_phone")%>" id=hidden8>
<input type=hidden name="fax"
value="<%=oDodgeCos3("f_fax_nbr")%>" id=hidden9>
The problem is that when I click on the box, it seems that the all
values is being passed over to the next page.


That's how it should work. All values on the form get passed to the
next page. It's up to your code on the next page to determine what
happens if a certain checkbox was checked.

May 10 '06 #4

P: n/a

Kevin Davis wrote:
Basically on the next page there is a form that stores the information
based upon the information. For example, I would click on both records
and I would only like to see the first record first then the next
record an so on. Basically the second page allows the user to modify
the data.


Your reply is even more confusing than the original :-)

Let's have a stab at this: The first page is supposed to represent all
records that can be edited, with checkboxes by each one so that the
user can tick the checkboxes against the records they want to update.
This information is passed over to the next page, presenting the
selected records in editable format. The second page then processes
any changes made to any of the records. Is that right?

If it is, then you do not need all the hidden fields on the first page.
Just the ID number for each record will do as the value for the
checkbox - making sure that the checkboxes all share the same name.
All the selected checkboxes will be passed in the Form collection as a
comma-separated string eg: Response.Write Request.Form("checkbox") will
give you 1,2,4,6,9 (if those were the selected checkboxes).

After validating Request.Form("checkbox") you just need to use the SQL
IN clause to select those records:

sql = "SELECT fields FROM table WHERE ID IN(" &
Request.Form("checkbox") & ")"

What will increase the difficulty of your task on the second page is
presenting all records in an editable format. You will have to append
the form field names with a counter so you can identify which, say,
surname belongs to which record being updated.

Hope I've guessed what you are trying to do correctly...

--
Mike Brind

May 10 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.