...

View Full Version : posting page



sasha85
11-19-2007, 05:06 PM
the page looks like that
http://ilmc.brinkster.net/comersus/crm/00help2.asp

in what way got to be the code built in order to check wich checkbox was checked and to get and update only the checked records fields?

sasha85
11-19-2007, 05:18 PM
what is the best way to set checks on the check boxs if it is checked or not...and to start reading those checked row fields?

TheShaner
11-19-2007, 05:54 PM
First, take the start of the form out of the loop and end it after the submit button, that way everything in your loop plus the submit button is in your form.

Next, change the checkboxes to radio and make sure they all have the same name and also have the loop put the credit card name as the value. This will then give your end user only one options to choose. Then, your text boxes will continue to be enabled and disabled with your javascript.

In your form processing, your Request.Form("radiobuttonnamehere") will hold the value of whatever credit card name they've selected.

-Shane

sasha85
11-19-2007, 06:00 PM
can you show some main part od the code?

TheShaner
11-19-2007, 06:35 PM
Example:

<form name="example" action="billing.asp" method="POST">
<table border=0>
<tr>
<th>payway</th>
<th>add</th>
<th>percentadd</th>
<th>minpay</th>
</tr>
<%
Dim count
count = 0
' start loop
count = count + 1
%>
<tr>
<td>
<input type="radio" name="creditcard" value="<%=rs("creditcardname")%>" onclick="enableDisable(this,'a<%=count%>','b<%=count%>','c<%=count%>','submit')" />
<%=rs("creditcardname")%>
</td>
<td><input type="text" name="a<%=count%>" value="<%=rs("ccaddvalue")%>" disabled onKeyUp="if (isNaN(this.value)) this.value=this.value.replace(/[^0-9.]/g,'')" /></td>
<td><input type="text" name="b<%=count%>" value="<%=rs("ccaddpercent")%>" disabled onKeyUp="if (isNaN(this.value)) this.value=this.value.replace(/[^0-9.]/g,'')" /></td>
<td><input type="text" name="c<%=count%>" value="<%=rs("ccminpay")%>" disabled onKeyUp="if (isNaN(this.value)) this.value=this.value.replace(/[^0-9.]/g,'')" /></td>
</tr>
<%
' end loop
%>
<tr><td colspan=4>
<input type="submit" value="add!" id="submit1" name="submit" disabled="disabled" />
</td></tr>
</table>
</form>
-Shane



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum