Help - going from javascript to asp

Results 1 to 2 of 2

Thread: Help - going from javascript to asp

  1. #1
    Join Date
    Dec 1969

    Default Help - going from javascript to asp

    HELP! <BR>I am going from an ASP page to javascript doing some field validation and then returning to the ASP page. My question is how do I get a value that I set in the javascript function into the ASP page? Right know it is set right in the javascript function but when I try to use it in the ASP page the value is zero.<BR><BR>Someone suggested<BR>Assign the value of the Javascript variable to a hidden form input object, then submit it to your ASP page.<BR><BR>But, I&#039m not sure what they&#039re suggesting because there is not a form<BR>in the function. <BR>How do I assign a hidden form input object in javascript.<BR>Could you show me an example?<BR><BR>Thanks for your help.<BR>Cathy<BR><BR><BR>

  2. #2 Guest

    Default RE: Help - going from javascript to asp

    The hidden form field is what I would suggest. You need to add a form:<BR>&#060;form method=Post action=xxx.asp name=HForm&#062;<BR>&#060;input type=hidden name=YourVal&#062;<BR>&#060;/form&#062;<BR><BR>Then in your JavaScript you set the value of the variable and submit the form:<BR>document.HForm.YourVal.value = "Something";<BR>document.HForm.submit();<BR><BR>Wh at you need to understand is that the client java and the ASP script are two different programs and they run on different machines. If you want to send values from ASP to client java, you write the values into the html page. If you set a variable in the clientside java, that&#039s where it stays, unless you transmit it via form post or querystring.

Posting Permissions

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