use this onblur event on your inputs:
<INPUT type="text" name="numeric" onblur='this.value=this.va
Main Topics
Browse All TopicsHi,
The folloiwng code displays data in an asp form from database for updating purpose. I want to force user to enter a number (no decimals or negative or zeros) in the "QtyOut_<%=iLp%>" fields. Could anyone pls. help me?
Zero is allowed only if user selected the check boxes in the form "Del_<%=iLp%>".
<%if not rst3.EOF then
iLp = -1
while not rst3.EOF
iLp = iLp + 1%>
<TR>
<TD width="40" height="1" align="center"><%=rst3.Abs
<TD width="150" height="1">
<INPUT name="PartNo_<%=iLp%>" ReadOnly value="<%=server.HTMLEncod
</TD>
<TD width="151" height="1">
<INPUT name="f_1_<%=iLp%>" value="<%=server.HTMLEncod
</TD>
<TD width="100" height="1">
<INPUT size=5 name="QtyOut_<%=iLp%>" value="<%=rst3("QtyOut")%>
<input type="hidden" name="OldQtyOut_<%=iLp%>" value="<%=rst3("QtyOut")%>
<input type="hidden" name="ROL_<%=iLp%>" value="<%=rst3("ROL")%>">
</TD>
<TD align="center">
<INPUT type="checkbox" name="Del_<%=iLp%>" value="True">
<INPUT type=hidden name="ID_<%=iLp%>" value="<%=rst3("ID")%>">
</TD>
</TR>
<%rst3.MoveNext
Wend%>
<tr>
<td colspan="5" align="right">
<input type="hidden" name="ItemCount" value="<%=iLp%>">
<input type="hidden" name="Action" value = "Update">
</td>
</tr>
<%end if%>
hafs.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
I want to force user to enter numeric values in the "QtyOut_<%=iLp%>" fields.
It should be something like this;
function mySubmit(obj)
{
var theForm=obj.form;
var p1=/^col1_/;
var num=/^[1-9]\d*/;
var oldCol1= new Array();
for(var i=0;i<theForm.elements.len
{
if(p1.test(theForm.element
{
if(theForm.elements[i].val
{
alert("Please enter a valid quantity");
theForm.elements[i+1].focu
return false;
But if user seletected <INPUT type="checkbox" name="Del_<%=iLp%>" value="True"> then 0 is allowed.
hafs
Business Accounts
Answer for Membership
by: StormyWatersPosted on 2004-08-10 at 08:08:06ID: 11763667
Do you want the user to be able to type any character in the box and then it checks it on submit or do you want it to only allow 1-9 and maybe 0 in the box and all other characters don't work?