Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2006, 05:56 AM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default putting values frm javascript f'n into session

hi ,
actually i'm new to javascript & want to put a value("document.navform.selectVal.value")present in javascript function into session so as i can access it into other jsp pages when required.here i'm submitting the form after user selects a value frm dropdown menu.
the jsp code is..

<html>
<head>
    <title>No Button Select Box</title>
    <script language="javascript">

    function testsubmit()
    {
        document.navform.selectVal.value=document.navform. workcenter.value;
        alert(document.navform.selectVal.value);
        document.navform.submit();
    }

</script>

</head>

<body onLoad="document.navform.reset()">
<span class="None"><span style="font-size: xx-small">

<div align="left">

<form name="navform" method="POST" action="">

<table width="224" border="0" cellspacing="0">
<tr>
    <td width="89">WorkCenter</td>
    <td width="131">

    <input type="hidden" name="selectVal">

    <select name="workcenter" onChange="testsubmit()">

    <option>

    <option value="WorkCenter 1">WorkCenter 1</option>
    <option value="WorkCenter 2">WorkCenter 2</option>
    <option value="WorkCenter 3">WorkCenter 3</option>
    </select>

    </td>
</tr>
</table>
</form>
</div>
</body>
</html>

thanks in advance...:)
 
Old December 18th, 2006, 01:10 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hai,
inside javascript you can not assign a jsp session, what you can do, onchange send it to another jsp page, from there you assign to a jsp session variable.
when you are assign use the hidden value and forword back to this page.

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Putting JavaScript Events on RadioButtonList Items MikeSchnell ASP.NET 1.0 and 1.1 Basics 6 October 7th, 2007 08:16 PM
Javascript to move cursor frm one textbox to othr lakshmi_annayappa Javascript 1 July 23rd, 2007 05:16 AM
Open & save 1 frm witout closing the prvs frm anukagni Access 3 January 10th, 2006 02:42 AM
putting asp and javascript together gilgalbiblewheel Classic ASP Databases 0 April 5th, 2005 07:33 PM
putting the values in the text box shoakat Classic ASP Databases 5 October 14th, 2004 02:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.