tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <j...@kewlstuff.co.za>
Subject Re: manipualting a select list from within an event handler
Date Wed, 24 Sep 2008 17:42:19 GMT

----- Original Message ----- 
From: "Robert Welz" <r.welz@pro2col.de>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Wednesday, September 24, 2008 4:20 PM
Subject: manipualting a select list from within an event handler


> Manipulating checkboxes from withing an onchange event handler works  but 
> I'd like to manipulate a select list like in this code example,
> but without luck? I'd appreciate some little help, that would be 
> fantastic.
>
>
> Thank's for some input here ;)
>
> kind regards,
>
> Robert
>
>
> function CheckAuswahl(currForm)
> {
>   a = document.form_addresses.form_protocol.value;
>     if(a==33554432)
>   {
>
> for(var x=0; x < currForm.elements.length; x++) {
> var y = currForm.elements[x];
>
> y.checked = currForm.form_exch_enabled.checked;
>
> if (y.name == "form_exch_enabled") {
> y.checked = true;
> //alert(y.name);
> }
>
> if (y.name == "form_exch_name") {
> if(y.value == "") {
> y.value = "ggg";
> }
> }
>
> if (y.name == "form_exch_pass") {
> if(y.value == "") {
> y.value = "ggg";
> }
> }
>
> if (y.name == "form_permitted_rcv") {
> //var a=y.createElement('option');
> //a.name="TEST";
> //y.focus();
> y.add('Test',null);
> alert(y.size);
> }
> }
>   }
> }
>
>
> <td><%=Label_Protocol%></td>
>           <td>
> <%
>               int intProtocol = Integer.parseInt(Value_Protocol);
> %>
>             <select name="form_protocol" 
> onchange="CheckAuswahl(this.form)" <%=Label_State%>>
>
> <option <% if ( intProtocol == sysProtocol_ZModem) {%>selected<%}%>
>                 value="<%=sysProtocol_ZModem%>">< 
> %=Value_Protocol_ZModem%></option>
>
> ---

Robert just looking at it... you passing a form element and the select in 
not in one...
Have a look at this example...

http://www.mredkj.com/tutorials/tutorial005.html

and Javascript is a mine field.... so get yourself FireFox at least and the 
plugin so you can see the whole DOM and what params are available...
Then make it work just in a normal HTML editor... then stick it in JSP... 
else its difficult...
Like for example... look at that example... can you see they making special 
allowances for IE... because microsoft are on their own mission.

Google for Javascript stuff... W3 Schools is quite good, but there are tons 
of tut sites out there
Javascript is something you really want to use in moderation... its not easy 
getting it cross browser compat...

And you'll get crapped out if you ask here ;)
Kinda fun though ;)

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------








---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message