Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Client side validation DB Value < input

    Hello,

    I have an asp Array I outpput the values of my array with a for each loop

    I am try to validate a form field called quantity but i keep getting syntax errors. since this is in a loop i use addToCart<%=Choose%> as the form name so it writes a function for every form that is written with my asp

    ### Code looks somthing like this ###

    For choose = 0 to Ubound(Products, 2)
    %>
    <SCRIPT LANGUAGE=JAVASCRIPT>
    function validateMyForm(){
    if(document.forms[0].addToCart<%=Choose%>.quantity.value=>"<%=Products(COL_QTY,Choose)%>"){
    alert("Quantity Exceeds Stock ");
    return false;
    }else{
    return true;
    }
    }
    </SCRIPT>
    <%
    Response.write("<form Name=addToCart"&Choose&" method=post action=blah.asp onSubmit=ValidateMyForm()><input type=text name=quantity value="&Products(COL_QTY,Choose)&"><input type=submit name=Submit></form>")
    Next
    %>

  • #2
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can some one please help !!!!

    Can anyone see what is wrong with this ???? this is the output f vew source

    ##########################################

    <SCRIPT LANGUAGE=JAVASCRIPT>
    <!--
    function validateMyForm8(){
    if(document.forms[0].addToCart.quantity.value=>"1"){
    alert("Quantity Exceeds Stock ");
    return false;
    }else{
    return true;
    }
    }
    -->
    </SCRIPT>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •