Problem writing to array

E

Ed Richter

I'm having problems posting data to a table. On a screen prior to the listing shown below, you select a time that a person's available.(displayed in Avail_Time field) Then when you go the page with the partial code shown below, it displays a bunch of dates and the "default" time you selected prior as name = Daily_time. There is a checkbox called Avail that you check or un-check for the dates you are available. Next to it in a field called daily_time is displayed the default time you had selected prior. What I want to do is give a person the option to change their available time for any one date. Maybe they selected their default as 4:00, but on March 13th, they need to make it 5:00 So they type in 5:00 on the row corresponding to Match 13th, then click the button to post to the table. Everything will work fine except, for example, if you had unchecked the first row in the table as being unavailable that day, the daily_time field doesn't know that it was unchecked therefore tries to apply the time in the first row of the table to the second row posted, which now became the first row (since first row was unchecked). Therefore, all of the avail_time data is one row off in the table.

Is there some way to get around this? Somehow concatenate two fields together?? Everything works fine, no errors or anything, just have bad data for the avail_time field if there were any rows unselected.

<td width="75"><input type="checkbox" name="Avail" value="<% = AvailObj("Date_rec") %>" checked></td>
<td width="118"><font face="arial,helv" size="3"><input type="text" name="Daily_time" size="12" value="<% = TimeObj("Avail_Time").value %>"></font></td>

Data above is written to table here
objConn.Execute "INSERT INTO Ref_available (Ref_ID_num, F_Name, L_Name, Date_rec, Match_time) " &_
"Values ('" & ID_num &"', '" & F_name_value &"', '" & L_name_value &"', '" & Request.Form("Avail")(i) &"', '" & Request.Form("Daily_time")(i) &"')"


Is there some way to apply more than one field to the check box. For example as shown below, with a link, I can assign more than one piece of data to be passed on to the next page when selected. Above, what is stopping me appears to be that the checkbox has both a name and a value, so don't know how to assign two pieces of data to that.

<td width="231"><font face="arial,helv" size="3"><A HREF="sportsmanship_scores_indiviual.asp?Team=<% = rsObj("Team") %>&League=<% = Request.Form("League") %>&Gender=<% = Request.Form("Gender") %>"><% = rsObj("Team") %></a></td>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top