NetTalk Central

Author Topic: DropList and xHtml  (Read 3225 times)

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
DropList and xHtml
« on: June 03, 2012, 02:18:02 AM »
Hallo,


Is there any way that we could inject xHtml code in a Drop List?
For the moment I see that DropList doesn't support xHtm :-(

Thank you,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: DropList and xHtml
« Reply #1 on: June 03, 2012, 09:24:15 PM »
what sort of xHtml are you thinking of Robert?

The drop list is using a <select> element in html. Perhaps post some example of a select here (ie the raw html) so I can see what you have in mind?

cheers
Bruce

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: DropList and xHtml
« Reply #2 on: June 03, 2012, 10:15:24 PM »
I would like based on a condition to have entries red or green.
Very easy to do in a browse but not in a drop list. DropList doesn't like xHtml on value. I have a drop list and I would like to make entries red for inactive and green for active. Users like this :o)
I try to inject xHtml on values but doesn't work...

Thank you,
Robert


[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: DropList and xHtml
« Reply #3 on: June 03, 2012, 11:08:45 PM »
those look like css sttings, not html. what html were you planning to inject to get this effect? Or are you really asking about CSS?

cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: DropList and xHtml
« Reply #4 on: June 03, 2012, 11:13:44 PM »
you can set the CSS for a line in the drop-list, on the CSS tab for that field. The entry to look for is
Drop Part:

Of course you can put an expression in here - as always - so I put in
choose(random(1,10)>5,'red','green')
and got a colorful drop-down like your screen-shot.

I'm guessing you have a slightly more clever expression, but the technique seems right.

cheers
Bruce

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: DropList and xHtml
« Reply #5 on: June 04, 2012, 09:56:19 PM »
Hallo Bruce,

It's working great!
The only thing it's that I lose green bar effect...

Thank you,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: DropList and xHtml
« Reply #6 on: June 04, 2012, 11:35:48 PM »
I haven't tested, but you might get to keep the greenbar effect if you "append" the class, rather than "replace" it. ie set the class name with a leading space. as in;

choose(random(1,10)>5,' red',' green')

Bruce

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: DropList and xHtml
« Reply #7 on: June 05, 2012, 04:40:53 AM »
Bruce!
You are the best!  :)
/Robert