Title: Message

John,

 

If your choicelist tag is not within a rows loop or a for loop, then <@currow> will be empty and  @@request$projects[<@currow>,2]

will be null. Try using @@request$projects[1,2] instead. Or maybe <@arg projectID> if you have that.

 

A useful debugging technique is to break the choicelist tag (ie <@  choicelist …>) so you can see what goes into the options, values and selected attributes of the tag in your results html.

 

Dave Shelley

 

 

-----Original Message-----
From: John Newsom [mailto:[EMAIL PROTECTED]]
Sent
:
March 31, 2004 1:14 PM
To: [EMAIL PROTECTED]
Subject: Witango-Talk: selected value in @choicelist

 

I have a drop down list that stays on the top of a page with the search results  below.  When a search is done using the list, I want the selected item to remain selected in the list, instead of the list reverting back to the default.  I can manually do it without using choicelist by having an if statement check the item id and add the word selected on true.  Is there a way to dynamically use the selected attribute of @choicelist?  I've  tried @currow  in the array element, but that doesnt seem to work.

 

Here is my code for choicelist:

 

<@CHOICELIST NAME="projects" TYPE=SELECT OPTIONS="@@request$projects[*,2]" VALUES="@@request$projects[*,1]" SIZE=1 SELECTED="@@request$projects[<@currow>,2]">

Here is my manual code for the other drop down list:

 

<SELECT NAME="student" SIZE="1">
<@ROWS array="usstudents">
<OPTION VALUE="@@request$usstudents[<@currow>,1]"
<@IF
EXPR="@@request$usstudents[<@currow>,1]=<@arg student>">selected</@IF>>@@request$usstudents[<@currow>,2] @@request$usstudents[<@currow>,3] @@request$usstudents[<@currow>,4] 

</OPTION>

</@ROWS></SELECT>

 

Thanks,

John

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to