Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Litteral Session Attribute

Status
Not open for further replies.

SDyke

MIS
Oct 13, 2005
55
US
I am trying to use JavaScript to read a session attribute Example: 861027-403

The result I am getting is a calculation(861027-403 = 860626) I want the result as a litteral string(861027-401) Which is what the value on the session attribule is.

Here is my JavaScript that is contained in my HTML page:

<SCRIPT type="text/javascript"><!--
function setNewDwgPrev(){
alert(${prevdwgno});
document.getdrawingnumber.dwgno.value = ${prevdwgno};
//document.getdrawingnumber.getDwgButton.click();
}
function setNewDwgNext(){
alert(${nextdwgno});
document.getdrawingnumber.dwgno.value = ${nextdwgno};
//document.getdrawingnumber.getDwgButton.click();
}

//--></SCRIPT>
 
All I know is it how I reference the session attribute.

Would you have any idea how I can use javascript to set a session attribute value.
 
Would you have any idea how I can use javascript to set a session attribute value.

You can't. Sessions are stored on the server and the SessionId value is created by the server.

[monkey][snake] <.
 
Then I need some other solution. What I have is a web app that looks up drawing data from a remote data source. The user types in the drawing number, clicks a button, a servlet calls a java class which connects and runs SQL based on the input. The default is an exact search. I need the user to be able to pick an option on the web page(radio button) to change the search to First in a Series or Partial drawing number. If one of these options is picked I need the servlet to do a preliminary SQL to find the fisrt drawing number that matches then run the base connection class. So in other words haw can the HTML radio button and JavaScript set a flag for the servlet to read. Now I have if{searchType == "Exact"} The radio button needs to give searchType a new value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top