tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mr. Cristian Romanescu" <>
Subject Re: Autopostback in JSP
Date Wed, 26 Feb 2003 08:02:14 GMT
Here are some hints:

At 09:00 PM 2/25/2003 -0800, you wrote:
>1)  I want the contents of my HTML page display to
>refresh automatically based on a selection made by the
>user. I am using HTML + JSP.
>For Example:
>   There are three radio buttons
>           - Thesis
>           - Non-Thesis
>           - Software Engineering
>   Drop Down Menu1
>If the user selects 'thesis' there should be one drop
>down menu appearing on the screen else there should be
>two drop down menus appearing.
>  How can I do that?

You have to do on the radio buttons, an JavaScript function which handler 
onClick (I think) event.
It would be something like this:

Here is a sample how an drop-down list works (I have it handy...)

JavaScript function:
     function MM_jumpMenu(targ,selObj,restore){ //v3.0
       if (restore) selObj.selectedIndex=0;
Here is the Drop-list that implements this functionality.
<SELECT name="Country" id="Country" onChange="MM_jumpMenu('parent',this,0)">
   <OPTION value="this.jsp?param=0">Please select a country</OPTION>
   <OPTION value="this.jsp?param=1">Any country</OPTION>
As you can see I pass using HTTP GET method the param field which shows me 
what used has selected.

Now you could adapt this code to your needs.

>2)  Also what function in JSP will allow my page to
>display one image if the mouse is placed on it and
>another image if the the mouse is not place on it?

2) That is called rollover and is done also from JavaScript. Search the web 
further for JS tutorials on that.
As a a startup, you should handle the onMouseOver and onMouseOut events in 
a <A href...> for example

here is some sample code:
<A href="link.jsp" onMouseOut="swapImg()" 
<IMG name="Image13" border="0" src="images/search/easy_search.jpg" 
width="84" height="29"></A>

hope this helps.

>I shall appreciate any help.
>Do you Yahoo!?
>Yahoo! Tax Center - forms, calculators, tips, more
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message