Page 1 of 1

selection of a drop down option, fill/replace/replace

Posted: Tue Jun 16, 2009 6:49 pm
by tata668
I try to select the select option that is the closest possible to the text I target. But I don't always know what the available options will be.

Let's say the text I target is "home insurance" in a "category" drop down input. It's possible that the closest option on a particular site will be "insurance", not "home insurance".

This is my iMacro:

===============
TAB T=1

SET !TIMEOUT 1
SET !ERRORIGNORE YES
SET !REPLAYSPEED FAST

'TAG POS=1 TYPE=SELECT FORM=ACTION:* ATTR=NAME:*category* CONTENT=$*real estate*
TAG POS=1 TYPE=SELECT FORM=ACTION:* ATTR=NAME:*category* CONTENT=$*home*
'TAG POS=1 TYPE=SELECT FORM=ACTION:* ATTR=NAME:*category* CONTENT=$*insurance*
'TAG POS=1 TYPE=SELECT FORM=ACTION:* ATTR=NAME:*category* CONTENT=$*home<SP>insurance*

==============

What I'd like it to do, is to select the "real estate" option if it is found, replace it with "home" if "home" is found, replace it with "insurance" if "insurance" is found and finally replace it with the best option, "home insurance" if it is found. But currently, what iMacros does is that if "insurance" is found, but "home insurance" is NOT found, it empties the drop down, it doesn't leave "insurance" as the selected option.

This is not useful for me because I can't manage my form filling as I'd like: fill/replace/replace.

Do you have something to suggest?

Thanks in advance!

Re: selection of a drop down option, fill/replace/replace

Posted: Fri Jun 19, 2009 9:00 am
by Marcia, Tech Support
Hello,

I believe you will need some kind of scripting to deal with all this conditions... Please, see http://wiki.imacros.net/FAQ#Q:_Are_ther ... statements... and http://wiki.imacros.net/Web_Scripting. If you are running the free iMacros Add-on for Firefox, it is also worth a look at http://wiki.imacros.net/iMacros_for_Fir ... _Interface.

Re: selection of a drop down option, fill/replace/replace

Posted: Fri Jun 19, 2009 12:44 pm
by tata668
I'll look into this!

May I suggest that, even without scripting, a way to prevent iMacros from modifying the selectedIndex of a select input when the text to find is not found, would be a really good idea!

Thanks for the help.