DropDown select

  • Автор темы Автор темы Alouka
  • Дата начала Дата начала

Alouka

Пользователь
Регистрация
30.07.2015
Сообщения
89
Реакции
5
Баллы
8
Hello :)

Is there any way to search for a value in a dropdown select box and select it ? (not by index)

Thank you !
 
you can always get innerhtml of the box and analyze its values and then select per mouse or type in the required value
try different parameters in the constructor and see which block it generates
you can also try selecting required value in record mode and look what's been generated
 
Thank you Nick for your reply. In record mode it process by the number of the item not the text. I need to select the right option depending on the value of a Variable ( it changes..). So it is not static choice for every time. I will try to understand the innertext as you said
 
Try entering value from keyboard in record mode, it might record it different way. It might make a block with a text value that you will later replace with a variable name.
Use "I like" button to thank me :-)
 
  • Спасибо
Реакции: Alouka и Tobbe
I have tried it but it doesnt record it differently ... Thank you anyway :)
 
Any other ideas please ? :)
 
Could you give an example of such element? code or link to page with it.
 
  • Спасибо
Реакции: Alouka
here is an example of my select :

<select class="form-control" id="mySelect" name="mySelect">
<option>---</option>
<option value="1">John Doe</option>
<option value="5">Maria abz</option>
<option value="8">Thom Cook</option>
<option value="10">Zeno poster</option>
<option value="12">No Fear</option>

So i want to select the option that is equal to my Variable on each time, and not to be based on the value (1,5...etc) :)
Thank you
 
You can use search in action designer:
instead of set - value
use set - selecteditems

as value you use real text of dropdown option for example Thom Cook
 
  • Спасибо
Реакции: Alouka
Thank you soo much :) It works selecting the element but it does not trigger the Js event so it is not showin the content that comes after this select depending on its value
 
Afte that use action designer on select tag and use mode Rise - onchange instead of Set - selecteditems
 
  • Спасибо
Реакции: Alouka
Oh My God !!! I love you Zenno Poster <3 Thank you !!!
 
And this won't work for radio boxes ? $$
 
rise - onchange triggers change event. should work in most of cases
 
I mean for selecting a radiobox based on its text label
 
No ) Radioboxes usually has different attributes to identify what you need to click
 
Hmm... So, the deal is to search for wanted text (label) and click on it. Is that possible ? Search for text then click on it ?
 
usually click on label triggers click on radiobox. You should test it
 
Yep it works with innertext value : the name of my item and rise a click :) Thank you Rosto !
 
O:)
 
However we can't inset a regex
 
Where
 
On set - selecteditems
 
Try Regex:*.John.* as value.
 
  • Спасибо
Реакции: Alouka

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)