10 years ago
7
Topic
Hi all,
I'm wondering, how can I get text instead of value when use conditional states in my FORM VIEW???
basically, i want to fill input with text from dynamic cascade.
FAQ says:
In order to retrieve a custom attribute, use fieldid@attribute

by default it is value, but how can i get text??? I tried fieldid@text = doesn't work !


Get a Book for SEBLOD
10 years ago
0
Level 1
Also I want to know if there is a possibility to get text (NOT VALUE) in computation rules.
By default - it is value
10 years ago
0
Level 1
hey! any ideas??? so simple idea....should work for both: hidden and visible fields...
I also tried title, name, label, html....doesn't work!
332 Posts
Kenneth
10 years ago
3
Level 1
I'm struggelign with the same thing. I found getText( 'art_catid' ); ?> that should work, but it's not.

Any luck in your end?
10 years ago
2
Level 2
I find out the following:
  1. you can get text from text field easily by "filled by"
  2. you can get text from simple select field if you will add & fill custom attributes for each option, and than use fieldid@yourattribute
that's all what seblod can. NOT possible to do it with
  1. select dynamic - problem (has something like custom attrib....but i don't know how to use it due to lack of information)
  2. select cascade - problem (not possible to use attribs with a goal to use conditional states later)

I see a way out for these two, if we could modify seblod's core files...I'd like to have functionality to add one custom attribute for selected option. And this attribute could be filled by text of option chosen. Than we could use conditional states and "filled by" fieldid@thatattribute (hope explained well)

at the moment I've only JS (based on jquery) to work with these frustrating fields. Here is my fiddle http://jsfiddle.net/terveg/fxJe4/







103 Posts
shubhaanshu
8 years ago
1
Level 3

Hi Friends!

Could you find any solution to this problem?

I also need a field to be "filled by" the "text" not "value" of another "Dynamic Cascade" field.

I believe there must be any solution.

Best Regards,

4229 Posts
Kadministrator
8 years ago
0
Level 4

Hi,

there is no way to get text directly. What you could do is create someAttribute in select dynamic with text as its value. Then you can read that attribute using fielid@someAttribute. ALternativaly you can use JQuery and do that with few lines of jQuery code.

10 years ago
0
Level 1
Hi again!

need some help with impovements in dynamic cascade plugin. Friend of mine has proposed very nice idea how to do it (as I described above).

He found a solution to change plugins\cck_field\select_dynamic_cascade\tmpl\form.php in line #106

$options.='<option value="'.$o->value.'">'.$o->text.'</option>';
on

$options.='<option label="'.$o->text.'" value="'.$o->value.'">'.$o->text.'</option>';
BUT! it doesn't work for first level of cascade....so need some help to finish this.
Hope, The result will be such that we can get "text" using conditional states

Here is a topic of hack's author 

Get a Book for SEBLOD