Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8608477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:37:16+00:00 2026-06-12T03:37:16+00:00

In the current screen I want to do a validation using javascript 1.User should

  • 0

In the current screen I want to do a validation using javascript

1.User should not enter the negative value in RO Qty. and

2.The RO Qty value should be less than shipped qty.

For first validation I written the javascript and called its in keypress
event of button .

  function onlyNumeric() {

        if (event.keyCode < 48 || event.keyCode > 57) {
            alert("Invalid RoQuantity,Quantity should not be negative.");
            event.returnValue = false;
        }
    }

Its working fine but when I want to add the validation for smaller and
greater in keyup and keydown then negative value validation is not working.

For 2nd validation I tried like this but not sucessfull

if (document.getElementById("ROQuantity").value > document.getElementById("shpdqty").innerHTML) {
            alert("Please Enter RO Qty, and ROQty shouldnot be greater then shipped quantity.");
            return false;
        }

This is also working but only for first row , so how to use for loop here so it will
work for all rows.

So please help me how to do it.

And one more thing this is ASP CLASSIC page.

This the TR tag where i am binding the value.

<tr valign="top" bgcolor="#E9E9E9">
      <td colspan="2" bgcolor="#FFFFFF" scope="col">
        <table width="100%" border="0" cellpadding="10" cellspacing="0" bordercolor="#E5E5E5"
                                        id="ctl00_ContentPlaceHolder1_GV">
            <tr bgcolor="#333333">
               <td scope="col">
                 <strong><font color="#FFFFFF">No</font></strong>
                </td>
                <td align="center" scope="col">
                  <strong><font color="#FFFFFF">Carton</font></strong>
                </td>
                <td scope="col">
                   <strong><font color="#FFFFFF">Article Code </font></strong>
                </td>
                <td align="center" scope="col">
                   <strong><font color="#FFFFFF">Color</font></strong>
                 </td>
                <td align="center" scope="col">
                   <strong><font color="#FFFFFF">Size</font></strong>
                </td>
                <td align="right" scope="col">
                   <strong><font color="#FFFFFF">Order Qty</font></strong>
                </td>
                <td align="center" scope="col">
                   <strong><font color="#FFFFFF">Shipped Qty </font></strong>
                </td>
                <td align="center" scope="col">
                   <strong><font color="#FFFFFF">RO Qty</font></strong>
                </td>
              </tr>
            <tbody>

         <% i =1
            set rs1 = server.CreateObject("adodb.recordset")
            sql1 = "SELECT     tblOrderAllocationListItems.OItemID, tblOrderAllocationListItems.MALItemID, tblOrderAllocationListItems.OrderNo, " & _
                    "tblOrderAllocationListItems.MALNo, tblOrderAllocationListItems.CartonName, tblOrderAllocationListItems.ArticleCode, " & _
                    "tblOrderAllocationListItems.Cup, tblOrderAllocationListItems.ColorID, " & _ 
                    "tblOrderAllocationListItems.SizeID, tblOrderAllocationListItems.UOM, tblOrderAllocationListItems.ArticleCostPrice, " & _
                    "tblOrderAllocationListItems.ArticleRCP, tblOrderAllocationListItems.OrderedQuantity, tblOrderAllocationListItems.ShippedQuantity, tblOrderAllocationListItems.ROQuantity, " & _
                    "tblArticleImage.ImagePath FROM tblOrderAllocationListItems LEFT OUTER JOIN " & _
                    "tblArticleImage ON tblOrderAllocationListItems.ArticleCode = tblArticleImage.ArticleCode where tblOrderAllocationListItems.OrderNo = '" & OrderNo & "' order by tblOrderAllocationListItems.CartonName, tblOrderAllocationListItems.ArticleCode"   
            rs1.Open sql1,strconnect,3,3,&H0001
            while Not rs1.EOF

            if i mod 2 = 0 then
            nbgcolor = "#F3F3F3"
            else
            nbgcolor = "#FFFFFF"
            end if

            orderamt = rs1("OrderedQuantity") * rs1("ArticleCostPrice")
            shippedamt = rs1("ShippedQuantity") * rs1("ArticleCostPrice")
            ShippedVarious = rs1("OrderedQuantity") - rs1("ShippedQuantity") 
            ROamt = rs1("ROQuantity") * rs1("ArticleCostPrice")
                                        %>
                                        <tr bgcolor="<%=nbgcolor%>">
                                            <td>
                                                <%=i%>
                                            </td>
                                            <td align="center">
                                                <font color="#000000">
                                                    <%=rs1("CartonName")%>
                                                </font>
                                            </td>
                                            <td>
                                                <a href="javascript:popup('http://www.anakku.com/v5/products_detail.asp?pro_id=609','photo','scrollbars=yes,resizable=yes,width=400,height=400')">
                                                    <font color="#000000">
                                                        <%=rs1("ArticleCode")%>
                                                    </font></a>
                                            </td>
                                            <td align="center">
                                                <a href="javascript:popup('http://www.anakku.com/v5/products_detail.asp?pro_id=609','photo','scrollbars=yes,resizable=yes,width=400,height=400')">
                                                    <font color="#000000">
                                                        <%=rs1("ColorID")%>
                                                    </font></a>
                                            </td>
                                            <td align="center">
                                                <font color="#000000">
                                                    <%=rs1("SizeID") & "/" & rs1("Cup")%>
                                                </font>
                                            </td>
                                            <td align="right" bgcolor="#D9D9FF">
                                                <font color="#000000">
                                                    <%=rs1("OrderedQuantity")%>
                                                </font>
                                            </td>

//I WANT TO COMPARE THESE TWO TD

               <td align="center" bgcolor="#C6FFC6" id="shpdqty">
                     <%=rs1("ShippedQuantity")%>
                </td>
               <td align="center" bgcolor="#D5E6FF">
                  <input name="ROQuantity<%=rs1("OItemID")%>" type="text" value="<%=rs1("ROQuantity")%>"
                                                    id="ROQuantity" size="5" onkeypress="onlyNumeric();" />
                                            </td>

                                        </tr>
                                        <%
            tOrderedQuantity = tOrderedQuantity + rs1("OrderedQuantity")                
            tShippedQuantity = tShippedQuantity + rs1("ShippedQuantity")                
            tShippedvariousQuantity = tShippedvariousQuantity + ShippedVarious              
            tROQuantity = tROQuantity + rs1("ROQuantity")
            tROamt = tROamt + ROamt

            i = i + 1
            rs1.movenext
            wend
            rs1.close
            set rs1 = nothing                   
                                        %>
                                        <tr style="color: #333333; background-color: white">
                                            <td colspan="5" align="right">
                                                <strong>Total Qty</strong>
                                            </td>
                                            <td align="right" bgcolor="#AEAEFF">
                                                <strong>
                                                    <%=tOrderedQuantity%>
                                                </strong>
                                            </td>
                                            <td align="center" bgcolor="#AAFFAA">
                                                <strong>
                                                    <%=tShippedQuantity%>
                                                </strong>
                                            </td>
                                            <td align="center" bgcolor="#AEAEFF">
                                                <font color="#000000">
                                                    <%=tROQuantity%>
                                                </font>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:37:17+00:00Added an answer on June 12, 2026 at 3:37 am

    Change it to:

    if (parseInt(document.getElementById("ROQuantity").value) > parseInt(document.getElementById("shpdqty").innerHTML)) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When the user changes screen, I want to hide the current ADBannerView . Is
I want to design a splash screen that can show the current loading process
current code (not working): /^script\s*type=\text\/javascript/i.test(tagName)
I want to know if user would return to the home screen if he
I want to know the content of the current screen display is created by
I want to Gnu Screen to dynamically rename the current Screen window after the
I want to add the ability for the users to capture the current screen
I have a flash calendar from which I want to download the current screen
I want the view of my current UIViewController to take the whole screen (without
i want to create message box which must be seen on current screen(Ex i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.