Categories > TinyButStrong general >

opt=html; addmissing bug?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: rein
Date: 2007-08-29
Time: 16:02

opt=html; addmissing bug?

I've got a working piece of code with the addmissing parameter, but it doesn't do [... ;select] with addmissing.

Correct me if I'm wrong, but I would expect that the missing parameter in a select will also be selected when you use a line like [data.category; ope=html; addmissing; select].
(I also tried [data.category; ope=html; select; addmissing])

So if [data.category] has a value that is not in the select as an option, how can I get it to be the selected option?
(currently it only adds the new option on the end of the list, but selects the first of the list)

I hope I provided enough info, since I didn't think more of a code example would help in this case, but if you need it, I would gladly post it.
By: Skrol29
Date: 2007-08-31
Time: 00:43

Re: opt=html; addmissing bug?

Hi,

When you use parameter "addmissing", the added items are build using the one with the TBS tag. So you just to have it selected in order to have the added items selected.

Example:
<select >
  <option value="[lst.id]">[lst.name;block=option]</option>
  <option selected>[var.sel_id;ope=html;select;addmissing]</option>
</select>
By: rein
Date: 2007-08-31
Time: 14:09

Re: opt=html; addmissing bug?

Great!

Maybe this should be documented in the manual, but if you think about it, it's pretty logical. Maybe I'm just stupid ;)
By: Skrol29
Date: 2007-08-31
Time: 16:39

Re: opt=html; addmissing bug?

It should be in the doc, of course.
That's not so logical, but it is functional :)