User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 375,249 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,159 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting

how can i pass a value from java script to JSP scriplet

Join Date: Jan 2006
Posts: 22
Reputation: hudz is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
hudz's Avatar
hudz hudz is offline Offline
Newbie Poster

Re: how can i pass a value from java script to JSP scriplet

  #9  
Oct 6th, 2006
but the structure above isn't dynamic enough.

What if you have this kind of situation:

<script language="JavaScript">

function sendVar(val){
document.form.pob1.value = val;

function show(id)
{
if (document.getElementById(id).style.display == 'none')
{
document.getElementById(id).style.display = '';
}
}

function hide(id)
{
document.getElementById(id).style.display = 'none';

}
}
</script>

In JSP

<table id="0">
<html:select name=country onchange="show('1'),hide('2');"/>
</table>

<table id="1" style="display:none;">
<html:select name="pob" onchange="setVar(this.value);"/>
</table>

<table id="2" style="display:none;">
<html:select name="pob" onchange="setVar(this.value);"/>
</table>

<input type="hidden" name="pob1" value="">

But, eventually Javascript didn't send the value to hidden name=pob1

I'm out of idea..

hehe..
-noIdea-
Reply With Quote  
All times are GMT -4. The time now is 4:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC