Forums Register Login

setting a jsp variable to a returned value of a javascript function??

+Pie Number of slices to send: Send
Is it possible to do this? fCheckNav checks the browser being used and returns a 10 for netscape versions less that 6 or 20 netscape versions 6 or greater and IE. The returned number is for the size of a textbox.
<input type="text" name="author" size="javascript:fCheckNav();"><font size="2">
if not possible how about setting a jsp variable to a javascript function like this:
int iSize = javascript:fCheckNav();
After setting the jsp variable i could use that to define the size of the text box depending on what browser the user is using.
+Pie Number of slices to send: Send
TexAbrey
first, your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
To set the size of the text box in javascript you can set it like this:
document.formName.textBoxID.size=4;
You can't set a jsp variable to a value calculated in client side javascript because is allready evaluated before it sent to the client and the javascript is done after it gets there.
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3237 times.
Similar Threads
passing jsp variable to java script function on same page
trouble calling two different functions
how to use jsp variables in javascript
Firefox problem when showing/hiding table rows
Javascript to JSP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:08:26.