Webmastersite.net
Register Log In

What is , doing in a field value
and why does it get there automatically?

Comments on What is , doing in a field value

david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted May 07, 2006 - 4:09 PM:

Hey Paul,


Most likely a stupid question, but it's causing problems.

I created a member text field, nothing special about it, been doing this a while. I created checkboxes for the values. When the value for the field is created from the value of the checkbox, it adds , before the actual value, in the database. This is fine so far, since this has been working for all my link fields, meaning that when I want to display the value of such a link field, it displays just fine.

BUT, this member field, now displays either nothing, OR the word YES, instead of the value of it, when I try to call it up on a webpage. If I remove the , from the field's value, then it displays just fine.

For example:
I have a member field called NEWTHING. I have 2 checkboxes for possible values for this field. Option A is 'super', option B is 'weak'.

If I put a check to 'super', then save the changes, the value of that field in the database will read:

, super

That's fine. But when I try to call up { MEMBERNEWTHING } in a browser, it either display absolutely nothing, or the word 'yes' .

If I manually remove the , before 'super' in the value of the field in the database, for that member, and then try to call up the value, then it displays the word 'super' just the way it should be.

Any ideas? I can't see this working this way properly. I cannot set my database field to an integer or anything else. This should be a text type DB field. I am also fine with the , in front of the field values, but then why doesn't it strip that? I think it does that for the link fields, but I haven't tested it, all I know is that all my link fields are displaying fine, even though some of them have those , in their values.

Thanks
David
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted May 07, 2006 - 6:04 PM:

When you do a checkbox field, you can't just dump the database value to the screen since checkboxes involve multiple values. The output value for the variable itself is, I believe, intended only for conditionals which want to know whether there's anything checked or not. Display stuff based on what's checked like this:
<IF {MEMBERCHECKED[fieldname <,> something]}>'something' is checked</IF>
<IF {MEMBERCHECKED[fieldname <,> somethingelse]}>'somethingelse' is checked</IF>
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.