Soren--

you may want to use the disabled attribute as in 
 form.v2.disabled=true;
 works for me ..(I do not know if the form.v2.readonly is operational)

also in the body of the code if your control is not passing any parameters use 
onChange="choose();" 

Tak,
Martin --
This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
----- Original Message ----- 
From: "Søren Blidorf" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Sunday, November 19, 2006 9:24 AM
Subject: javascript and readonly in struts


Hi.

I am trying to convert the following in to struts taglib

<script language="javascript">
function choose() {

  if (this.form.v1.selectedIndex==3) {
  this.form.v2.readOnly=true;
  this.form.v2.value='';
  }
}
</script>

<select name="v1" onchange="choose(selectedIndex)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>

<input type="text" name="v2">

How do I make this work:

<script language="javascript">
function choose() {

  if (this.form.v1.selectedIndex==3) {
  this.form.v2.readOnly=true;
  this.form.v2.value='';
  }
}
</script>

<html:select property="v1" onchange="choose(selectedIndex)">
<html:option value="1">1</html:option>
<html:option value="2">2</html:option>
<html:option value="3">3</html:option>
</html:select>

<html:text property="v2">

Søren Blidorf

Nolas Consulting
Automatikvej 1
DK-2860 Søborg


Telefon: +45 32713661
Direkte: +45 61676513
Webside: www.nolas.dk



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to