Webmastersite.net
Register Log In

Added combo box field, strange behavior.
script is recording data but output is wrong.

Comments on Added combo box field, strange behavior.

sparkalina
Forum Regular

Usergroup: Customer
Joined: Nov 26, 2003

Total Topics: 70
Total Comments: 211
Posted Mar 03, 2009 - 12:36 AM:

I added a multi-select combo box field to wsnlinks (my first so I don't know if this is expected behavior).

Template code appears functional, db is recording my choices, but when I use

{LINKFIELDNAME} the html output is "yes" and not any of the choices I have listed as options.

It's like it's acknowledging there is data in that field but won't list the data.

The data in the db field shows:

, option1, option2,

I added an identical second field, just to make sure it wasn't my error and that field is also spitting out "yes"


Template html created by db is:


<input type="hidden" name="fieldname[123]" value="" /><select multiple="multiple" size="5" name="fieldname[]"> <option value="a">a</option>
<option value="b">b</option>
</select>



I was having this issue in 4.X as well before I upgraded to the 5.0 series today.

Am I doing something wrong?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Mar 03, 2009 - 6:20 AM:

For display on multiselector or multicheckbox data you need to use <IF {LINKCHECKED[fieldname <,> value]}>value is selected</IF> <IF {LINKCHECKED[fieldname <,> value2]}>value2 is selected</IF> etc. Yeah it's messy and counterintuitive, but somehow it made sense at the time...

I'll add a {LINKSELECTIONSLIST[fieldname]} for 5.0.38 to produce a comma separated list, but it's not currently there.

Having {LINKFIELDNAME} itself show a comma separated list would introduce a slew of bugs, according to the code comment I have marking a previous attempt to do that: "DON'T try the following again. BAD coder. It messes up many processing spots." So I'm taking my advice and leaving that alone.

I've revised and improved the "add fields" knowledge base entry, which wasn't really making things clear at all before and hopefully is now.
sparkalina
Forum Regular

Usergroup: Customer
Joined: Nov 26, 2003

Total Topics: 70
Total Comments: 211
Posted Mar 03, 2009 - 10:16 AM:

thanks!

A comma separated list of values chosen from the combo box is exactly what I need.

In my case, I'm creating a selection of specific "keywords" a user must choose rather than type them in themselves using a regular input text field. This helps my custom built search queries because I've controlled the keywords to avoid misspellings, and typos using the combo box.

I'll try out the current method of display until the upgrade comes around.


BTW. I did read the KB on the topic and didn't understand that it included the multi combo box, but as I re-read it now based on your comments above, it's making more sense now. I think changing it to list all values with comma separation is a wise decision to reduce questions.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.