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 Coder
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem client - server / ASP vs. Javascript

    Hello,

    I have a problem wich I think it has to do with client - server. I'am writing a page with ASP. I'am writing back some data in selection fields.
    With Javascript function I assign the value to 'IFOR_Attr_1':
    Code:
    document.all['IFOR_Attr_1'].value = TTTEXT_IFOR_array[selindex-1];
    alert("If-waarde parm Field: " + Field + " waarde parm IFOR_Field: " + document.all['IFOR_Attr_1'].value);
    With the alert I see the value of 'IFOR_Attr_1' is 1. this is correct.

    But further in the code I need this value with a ASP request on IFOR_Attr_1 like:
    Code:
    Call displaytext("Attr_1 " + Request("IFOR_Attr_1"))
    Call WriteKenmerkenCriteria("Attr_W1", Request("IFOR_Attr_1"), Request("CHAR_Attr_1"))
    But now is the value of IFOR_Attr_1 empty. At least not 1.
    My conclusion is that the value for IFOR_Attr_1 is at the client side changed but not at the server side?

    How can I solve this?

    Anyway is it possible to assign a value to a ASP variable with javasript code like:
    Code:
    Dim Aspvar
    Aspvar = javascript:function()
    Thanks in advanced,

    Nico

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    The asp code is processed long before the javascript is even written out. Server side code is always executed before client side code is. If you need to alter a value using clientside coding, then you need to submit the page afterwards for the server to see the alteration.


  •  

    Posting Permissions

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