Newbies tewan Posted July 9, 2003 Newbies Posted July 9, 2003 I have a popup list created using a value list of dates in my database. Using CDML, I created a search page that contains this list, and I want the popup to appear with a date that I have set in a Global field by default. For example, when I set the date to 7/1/03 in my global date field, and the search page is accessed via the web, I want my date popup to show: 6/1/03 - 7/1/03 8/1/03 9/1/03 etc.... The user can select another date if they wish, or simply accept the default when submitting their search. Any ideas how to accomplish??
omiossec Posted July 9, 2003 Posted July 9, 2003 In cdml you will need to use javascript to create you popup
Leb i Sol Posted July 9, 2003 Posted July 9, 2003 "when I set the date to 7/1/03 in my global date field"??? :?? I am not following....when u search for the record that has this date ooor? u dont need pop-up u can simply submit the form with the target of "_self" and it will "open" a new window with the results...where u can "highlight-emphasise" the record/date serched for... all the best
LaRetta Posted July 9, 2003 Posted July 9, 2003 Hi Tewan, Quote set the date to 7/1/03 in my global date field Uhhh, you need to follow date format if the global is a date field, or you'll need to convert it to date format when using it. '03' is an invalid year. If you want Users to be able to enter any type of date format (03 for year, dashes, etc.) and it automatically be converted to FM date format, there are ways to do that also. Anyway, this probably isn't your problem, but just in case I thought I would mention it. LaRetta
Garry Claridge Posted July 9, 2003 Posted July 9, 2003 You can use a [FMP-If] condition to test; e.g. <select name="mydate"> [FMP-ValueList: mydate, List=myDateList] [FMP-If: ValueListItem .eq. Field:myGlobalDate] <option value="[FMP-ValueListItem]" selected>[FMP-ValueListItem]</option> [FMP-Else] <option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option> [/FMP-If][/FMP-ValueList] </select> Hope this helps. Garry
Garry Claridge Posted July 9, 2003 Posted July 9, 2003 If the date in the Global Field is not a member of the ValueList you could amend the CDML to look like this: <select name="mydate"> <option value="[FMP-Field:myGlobalDate]" selected>[FMP-Field:myGlobalDate]</option> [FMP-ValueList: mydate, List=myDateList] <option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option> [/FMP-ValueList] </select> All the best. Garry
Newbies tewan Posted July 10, 2003 Author Newbies Posted July 10, 2003 Gary, Thanks for your response. It appears that you know exactly what I'm asking. FYI, the Global field that I'm comparing the value list items to is, in fact, a value that equals one of the ones in the value list (so your second example does not work for me). I tried the following and only get a blank popup. Do you see any syntax problems? Thanks for your help. <select name="DateRange"> [FMP-ValueList: DateRange, List=DateRangeList] [FMP-If:ValueListItem.eq.Field:GlobalRange] <option value="[FMP-ValueListItem]" selected>[FMP-ValueListItem]</option> [FMP-Else] <option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option> [/FMP-If][/FMP-ValueList] </select>
Garry Claridge Posted July 10, 2003 Posted July 10, 2003 I have just been trying that. A few strange things happening This seems to work, partially, in the [FMP-If]: [FMP-If: g_curr_sport .eq. {ValueListItem}] (rather than what is described in the "CDML Reference" database) However, the [FMP-ValueListItem] tags, which follow, are not displaying. I am using a "-findany" in the calling URL so that the Global Field can be read. Also, be aware that Related ValueLists do not work through WebCompanion. I will do some more testing to see what is happening!!! Good Luck. Garry
Newbies tewan Posted July 10, 2003 Author Newbies Posted July 10, 2003 Yes, I know that a Value List from a related file won't work. The value list is defined in the local file. I am able to generate the popup list without any problem when I exclude the [FMP-If:] tags, but again, the first item in the list is always selected. I am also executing a "-FindAll" on the referring page, so that the global field is availble. I tried your newest incarnation above with the [FMP-If: g_curr_sport .eq. {ValueListItem}] syntax without any change - I still get a totally blank popup.....I've tried several variations on placement of the [FMP-If] tag, etc. without any positive result...any more ideas?? Todd
Recommended Posts
This topic is 7908 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now