Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tutorial or help on this...

Status
Not open for further replies.

aspnet98

MIS
May 19, 2005
165
US
I have a basic table that I need to update. The data is shown below. I used DW's update wizard and it will works for one record updates but if i add a repeat region it will not...My table has varying records so i need to make it dynamic. this task is so simple in access i just don't get it in dw...

Can someone show me how to do this in dreamweaver using all of the tools?

database:
id bit
1 1
2 0
3 0

asp vbscript page
1 1 * true false <-Radio buttons
2 0 true * false
3 0 true * false

SUBMIT Button

Backend SQL server 2000
ASP VB script

I tried to but it using dreamweaver repeat region and update function which fails.....

anyone, please help me?
 
thanks so much for the help. Can I try those then ask you questions on them? I have been stuck on this for months...

I am new to asp and just learning loops.


Thanks AGain!
 
sure, I haven't used them, but will be glad to help out where I can.

Dodge20
 
hey dodge,
I made great progress thanks to you but i still have some issues.

I modified the code in that the rec num ( is now two check boxes that write back to the db as 1 or 0. I need to add two more things:
1) have the check boxes display what is in the database field (null = no checks, 1 = check, 0= no check).
2) Only allow one check box to be selected at form level.

here is the modified checkbox code from the article you provided:

<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<% intRecID =(Recordset1.Fields.Item("RecID").Value) ' Store the current RecordID in a variable %>
<tr>
<td nowrap><font size="1" face="Arial, Helvetica, sans-serif"><%= intRecID %><input name="hidRecID<%= intRecID %>" type="hidden" value="<%= intRecID %>" size="5"></font></td>
<td nowrap><font size="1" face="Arial, Helvetica, sans-serif"><input name="txtText<%= intRecID %>" type="text" onChange="RecUpdate('<%= intRecID %>')" value="<%=(Recordset1.Fields.Item("RecText").Value)%>" size="20"></font></td>
<td nowrap><input <%If (CStr((Recordset1.Fields.Item("RecNum").Value)) = CStr("1")) Then Response.Write("checked") : Response.Write("")%> <%If (CStr(Abs((Recordset1.Fields.Item("RecNum").Value))) = CStr("1")) Then Response.Write("checked") : Response.Write("")%> name="txtNum<%= intRecID %>" type="checkbox" onChange="RecUpdate('<%= intRecID %>')" value="1" size="20"></font></td>
<td nowrap><input name="txtNum<%= intRecID %>" type="checkbox" id="txtNum<%= intRecID %>" onChange="RecUpdate('<%= intRecID %>')" value="0" size="20" <%If (CStr((Recordset1.Fields.Item("RecNum").Value)) = CStr("1")) Then Response.Write("checked") : Response.Write("")%> <%If (CStr(Abs((Recordset1.Fields.Item("RecNum").Value))) = CStr("1")) Then Response.Write("checked") : Response.Write("")%>></td>

</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>


Thanks so much.
 
I accomplished step two but changing the type to Radio , which is fine for this form, so now it only lets me pick one or the other.

Lastly, I need to prepopulate the radio button with the selected db value.

1) have the radio button display what is in the database field (null = no checks, 1 = check, 0= no check).
 
I figured it out! Thanks for those articles. Here is the code so it will help anyone else out in the same boat as me!

<tr>
<td nowrap><font size="1" face="Arial, Helvetica, sans-serif"><%= intRecID %><input name="hidRecID<%= intRecID %>" type="hidden" value="<%= intRecID %>" size="5"></font></td>
<td nowrap><font size="1" face="Arial, Helvetica, sans-serif"><input name="txtText<%= intRecID %>" type="text" onChange="RecUpdate('<%= intRecID %>')" value="<%=(Recordset1.Fields.Item("RecText").Value)%>" size="20"></font></td>
<td nowrap><input name="txtNum<%= intRecID %>" type="Radio" onClick="RecUpdate('<%= intRecID %>')" value="1" size="20" <%If (CStr((Recordset1.Fields.Item("RecNum").Value)) = CStr("1")) Then Response.Write("checked") : Response.Write("")%>></font></td>
<td nowrap><input name="txtNum<%= intRecID %>" type="Radio" id="txtNum<%= intRecID %>" onClick="RecUpdate('<%= intRecID %>')" value="0" size="20" <%If (CStr(Abs((Recordset1.Fields.Item("RecNum").Value))) = CStr("0")) Then Response.Write("checked") : Response.Write("")%>>
</td>

</tr>
 
Hey guys and gals,
I am back again with this example. I need to make sure every radio button on this form is selected when submitting. I tried a javascript validation but it fails because the buttons are created dynamically from a loop. See above...

Can someone help me accomplish this?
 
You could use the recordcount to decide how many records there are then validate off the back of that information using an array

Cheech

[Peace][Pipe]
 
Could you help me write this?

Can you help me with a javascript method?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top