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
    Jun 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    doubt in javascript

    my asp page contains dynamic controls,in each page controls come dynamically. what i want to do is to access asp variable in javascript validation functions, is it possible or please suggest me a way to validate these form controls which come dynamically according to some question type.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    something like this?
    <%
    dim aspStr, aspNum, aspBool
    aspStr = "blah"
    aspNum = 1
    aspBool = True
    %>
    <script type="text/javascript">
    var jsStr = "<%=aspStr%>";
    var jsNum = <%=aspNum%>;
    var jsBool = <%=LCase(CStr(aspBool))%>;
    alert(jsStr);
    alert(jsNum);
    alert(jsBool);
    </script>
    Of course, you can't just directly insert asp objects in js, such as arrays, ADO objects, FSO objects and the like.


  •  

    Posting Permissions

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