FWIW, it's cleaner to simply pass in the object itself rather than its name.
Here's how I'd write it:
function changevalue(Field) {
var oldvalue;
var newvalue;
oldvalue = Field.value;
TAKE ACTION HERE
Field.value = newvalue;
}
....and here's an example of how to pass in the Field object:
<form method="post" onsubmit="return changevalue(this.mytextfield)">
<input type="text" name="mytextfield"><p>
<input type="submit">
</form>
-David
On Wednesday, April 18, 2001 12:30 PM, Bruce, Rodney [SMTP:[EMAIL PROTECTED]]
wrote:
> Thanks for all the suggestions
>
> The one I got to work was Mark's below.
>
>
> Thanks again
> -----Original Message-----
> From: Mark Rowntree [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 18, 2001 9:15 AM
> To: CF-Talk
> Subject: Re: Setting form var with Java
>
>
> try:
>
> document.forms[FormName].elements[FieldName].value
>
> Let me know.
>
> Mark Rowntree
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists