This will change your selection from 1->2->3->1:
By the way if I were asked this in an interview I won't be able to come up
with this, so what does this tell? I actually had to check the JavaScript
syntax online, but it totalled
about 2 minutes for the solution.
<html>
<head>
<script language="javascript">
function ChangeVal(a) {
document.aform.hi.selectedIndex=(a+1)%3;
}
</script>
</head>
<body>
<form name="aform">
<select name="hi" onchange="ChangeVal(this.selectedIndex)">
<option value="1">1
<option value="2">2
<option value="3">3
</select>
</form>
</body>
</html>
> -----Original Message-----
> From: João Mota [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 12:07 PM
> To: [EMAIL PROTECTED]
> Subject: Help !! - Forcing an event
>
>
> Hi all,
>
> I have a problem in a SELECT tag
>
> I have
> <SELECT NAME= "hi" onChange="changevalue()">
> <OPTION> 1 <OPTION>
> 2 <OPTION> 3 </SELECT>
>
> and i want to exchange from from one value to the
> others, but when i
> select 3 i want the list box to show 1, but not duplicating
> the values in
> the box.
>
> Since when i select 3 the box shows 3, i need to force
> an event so the
> box will show the 1 value.
>
> thx,
>
> J
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets