Passing JavaScript values to Session

Results 1 to 2 of 2

Thread: Passing JavaScript values to Session

  1. #1
    jmoneill Guest

    Default Passing JavaScript values to Session

    I have an application where the user will select a line from a <BR>listbox (a list of projects). After a project is selected, they <BR>will then press a hyperlink(&#060;a&#062;) JavaScript rollover image. My <BR>problem is that since they are not pressing a button, but using a <BR>link, is how do I know what project was selected when I get to <BR>the next page?<BR><BR>I thought that I could either do an OnChange on the listbox, or <BR>an OnClick on the link. The JavaScript function called could then <BR>get the selected text from the listbox. So far so good...but now <BR>how to pass it to the next page? I can&#039t shove it into a hidden <BR>field, since these are not passed with a link. The optimal method <BR>would be to pass it in the Session. Within my JavaScript function <BR>I can force a Session entry with the following line:<BR> &#060;% session( "projectNo" ) = "12345" %&#062; <BR>That worked great, but not overly useful. What I need to do is <BR>after I issue the following JavaScript command:<BR> projNo = document.ProjSelect.lbProjList[i].text;<BR>to somehow get "projNo" into the session(or to the next form). I <BR>guess what I am asking is:<BR> 1) is this a reasonable way to pass values from one form to <BR>the next using links?<BR> 2) can I pass values from within a JavaScript function into <BR>the Session?<BR> 3) if # 2 can&#039t be done, then would I return the selected <BR>value from the JavaScript function back to VB and somehow pass it <BR>to the next form? Can this be done since the link has already <BR>been invoked?<BR><BR><BR>TIA,<BR>john

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing JavaScript values to Session

    You may want to use form tags aroung the drop down list box and then apply a JavaScript command to the HREF attribute of the link. The JavaScript command would then call a client-side JavaScript function to submit the form.<BR><BR>For example<BR>function SubmitForm(){<BR>frm = document.form<BR>frm.submit()<BR><BR>}<BR><BR>&#06 0;A HREF="javascript: SubmitForm()"&#062;<BR><BR>Hope this helps!

Posting Permissions

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