Can you set the default value for a select box?

Use this board to ask questions or have discussions with other Genie users.
Post Reply
rmarsh
Profound User
Posts: 56
Joined: Tue Jan 20, 2015 4:28 pm
First Name: Raymond
Last Name: Marsh
Company Name: Cracker Barrel Old Country Sto
Phone: 615-235-4215
Address 1: PO Box 787
City: Lebanon
State / Province: Tennessee
Zip / Postal Code: 37088
Country: United States
Contact:

Can you set the default value for a select box?

Post by rmarsh »

I've set up a couple of select boxes that work well but in some cases I would like the default selection to be different than what is showing up.

It appears that the last selection is the default. Is there anyway to cause it to response to what is already in the 5250 fields?

For example if I_26_12 contains a "1" set the default to "Yes".
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Can you set the default value for a select box?

Post by Scott Klement »

The 'default' selection (the one that's selected when the select box is first shown to the user) is based on the value that's in the underlying green-screen field.

So if you have a select box that has 'Yes' and 'No' as choices, and 'Y' and 'N' as the corresponding values, then when the green-screen sends Y, it will set the select box to "Yes", and when the green-screen sends "N" the select box is set to "No".

The only time it'd pick one that doesn't select to the green-screen field's value is if there is no match. (i.e. the select box does not have a value that matches the green-screen field value.) This is considered an "invalid" situation -- the list of values should always include all possible values that can ever be in the field. The only exception is when using a database-driven select box, you may want blanks to be a valid option (despite that it's not in the database.) In that situation you can use the "blank option" fields to enable blanks as a valid value.
rmarsh
Profound User
Posts: 56
Joined: Tue Jan 20, 2015 4:28 pm
First Name: Raymond
Last Name: Marsh
Company Name: Cracker Barrel Old Country Sto
Phone: 615-235-4215
Address 1: PO Box 787
City: Lebanon
State / Province: Tennessee
Zip / Postal Code: 37088
Country: United States
Contact:

Re: Can you set the default value for a select box?

Post by rmarsh »

That is what is happening. I had to go back and double check it. Thank you.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests