Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Instant Website: Realty/Listings/Auto:
Specify a default option for a dropdown list

 

 


kblm
User

Mar 16, 2009, 4:30 PM

Post #1 of 2 (2652 views)
Shortcut
Specify a default option for a dropdown list Can't Post

I added a dropdown list to our Instant Realty app. However, at this time there is only value for that list. The list data is stored in the schema ini file (not a mysql table).

This field is required.

This question applies to all lists in general. Is there a way to make one of the list values a default selected, instead of <select>?

Thanks!

-Kevin


Dave
Staff / Moderator


Mar 17, 2009, 11:21 AM

Post #2 of 2 (2592 views)
Shortcut
Re: [kblm] Specify a default option for a dropdown list [In reply to] Can't Post

Hi Kevin,

No, there's currently no way to set a default list value.

A few options, you can show a default value if none is selected (you'd have to make the field not-required) like this:

<?php if (!$record['fieldname']): ?>
... this is shown if no value is selected ...
<?php endif ?>

Or if you really wanted that feature I can give you instructions on how to remove that line from the code that adds the <select> and that would make the first option the default.

Hope that helps, let me know if you want more details on either of those approaches.

Dave Edis - Senior Developer
interactivetools.com