Your code works for me (IE).

But the "change" event is fired only when the textfield losts focus and the text was modified. For example modify the first field then press tab. The second field's value will change.

Maybe consider using the "keypress" event instead of "change" to make it "realtime": <input jwcid="@TextField" value="ognl:object.dob" type="text" name="dob" onkeypress="myFunction()" />

Br,
Norbi

----- Original Message ----- From: "Muhariz Jabeer" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, June 13, 2005 10:24 PM
Subject: Basic Scripting Help


Hi I'm realy new to Tapestry and wanted to do some simple client side
scripting. I have 2 textboxes, both bound to string
properties in an object. All i want to do is when one of the textbox's
onChange( ) method is fired, I want to set the value
of the other text box to something. Can somebody please help?

what i have right now is the following html:

<html>
<head>
<title>Date Scripting</title>

<script type="text/javascript">
function myFunction()
{
document.forms[0].age.value = "Some value";
}
</script>

</head>

<body>
<form jwcid="@Form" action="">
DOB: <input jwcid="@TextField" value="ognl:object.dob" type="text"
name="dob" onchange="myFunction()"></input>

<br/>

Age: <input jwcid="@TextField" value="ognl:object.date" type="text"
name="age"/>


</form>
</body>
</html>



Thanks.

--
In a long enough timeline,
every moment will feel like deja vu.
-Muhariz.



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

Reply via email to