Hi Bill
I use basically the same line of code, works great.
Only thing I can see is drop the ".options" and drop the quotes around
"true".
In the code below, RT is the argument name the value in brackets equates to
an integer value.
document.hotel.RT[document.hotel.TixQuant.value].selected = true;
And do'nt forget the first item in the list is [0].
Hope it helps,
Chuck
----- Original Message -----
From: "Bill Downall" <[EMAIL PROTECTED]>
To: "Multiple recipients of list witango-talk" <[EMAIL PROTECTED]>
Sent: Sunday, August 11, 2002 5:39 PM
Subject: Witango-Talk: JS: stumped dynamic SELECT option selection
> I'm stumped looked through JS references and examples for the way
> to do this. I have a blank date field. When it is filled (with the help of
> javascript that allows date "shorthand"), I want a drop-down list later in
> the form to dynamically change its selection from "pending" to
> "scheduled" (only for one particular "typeID" value in a third field.)
>
> The script and form fields below show my latest attempt. I don't get a
> runtime error, but I also don't get any change in the drop-down. (left
> square brackets have replaced most angle-brackets to help keep your
> email reader from trying to interpret or run anything.)
>
> Thanks in advance for any help.
>
> Bill
>
> [SCRIPT language="JavaScript">
>
> function onDateEntryChangeStatus()
> {
> if ( document.formDetails.TypeID.value == "500" )
> { document.formDetails.StatusCode.options[2].selected =
> "true";
> return true;
> }
> else
> { // n/a for other types
> return true;
> }
> }
> // -- End JavaScript
> [/SCRIPT>
>
> [FORM METHOD="POST" ACTION="<@APPFILE>"
> NAME="formDetails">
> [INPUT TYPE=HIDDEN NAME="_function" VALUE="update">
> [INPUT TYPE=HIDDEN NAME="_recordID" VALUE="<@ARG
> _recordID">
> [INPUT TYPE=HIDDEN NAME="TypeID" VALUE="<@COLUMN
> TypeID>">
> [INPUT TYPE=HIDDEN NAME="_UserReference"
> VALUE="<@USERREFERENCEARGUMENT">
> [INPUT NAME="ScheduledDate" TYPE=TEXT SIZE=8 MAXLENGTH=
> 10 VALUE="" onBlur="dateShortHand(this,'no')"
> onchange="onDateEntryChangeStatus()">
> Status:
> [SELECT name="StatusCode">
> [OPTION VALUE="">N/A
> [OPTION VALUE="PEND">Pending (face to face)
> [OPTION VALUE="SCHD">Scheduled
> [OPTION VALUE="CMPL">Completed
> [/SELECT>
> [/FORM>
>
>
>
>
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
> with unsubscribe witango-talk in the message body
>
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body