Multiple selection with considering previously selected item

Discussions and Tech Support specific to the iMacros for Chrome extension.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
lesha_01
Posts: 3
Joined: Fri Jul 20, 2018 7:46 am

Multiple selection with considering previously selected item

Post by lesha_01 » Fri Jul 20, 2018 8:03 am

Hello.
I have IMacros for Chrome VERSION BUILD=1001, Chrome 67.0.3396.99.
I always use standart code for multiple selection menu:

Code: Select all

TAG POS=1 TYPE=SELECT FORM=NAME:form1 ATTR=NAME:select1 CONTENT=#1:#3:#8 
It works fine. But If in menu previously were selected other items (#4 and #5, for example) they are not saved after running this code.
On keyboard I can hold CTRL button to add new items in multiple menu (with saving previously selected items), and how I do this in IMacros?
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Multiple selection with considering previously selected

Post by chivracq » Fri Jul 20, 2018 12:06 pm

lesha_01 wrote:Hello.
I have

Code: Select all

IMacros for Chrome VERSION BUILD=1001, 
Chrome 67.0.3396.99.
I always use standart code for multiple selection menu:

Code: Select all

TAG POS=1 TYPE=SELECT FORM=NAME:form1 ATTR=NAME:select1 CONTENT=#1:#3:#8 
It works fine. But If in menu previously were selected other items (#4 and #5, for example) they are not saved after running this code.
On keyboard I can hold CTRL button to add new items in multiple menu (with saving previously selected items), and how I do this in IMacros?
Your Thread has probably nothing specific to the 'iMacros for CR' Sub-Forum btw..., unless you can mention that you've tested in some other Browser, "correct" Sub-Forum would have been the 'General' one... (for next time, no need to duplicate now...)

Hum..., are you sure you are using v10.0.1 for CR...? (Some v10.0.2 for CR Update was released a few weeks ago...)
And for v10.x, you need to mention as well if you are using the 'Free' or 'PE' (Personal Edition)...
+ OS is missing from your FCI...
['Free'/'PE' + 'OS' shouldn't play a "Role" in this Thread I think, but I usually don't answer Threads if FCI (and the 'F' stands for "Full", read my Sig...) is not mentioned or not complete... :idea: )

>>>

OK, hum, interesting Qt... :D , but I'm not surprised by the "Behaviour" you describe... :|
You probably need to first "save stg" about your first Selection with Items '#4' & '#5' (but it depends a bit on how the Page works I guess), before letting your Script do the Selection '#1:#3:#8'...
You would get the same Behaviour I think if you started typing manually stg in some 'IMPUT' Field, without saving/submitting, and then letting some iMacros Script fill in that same 'INPUT' Field..., the "manual" Content will be replaced by the Content from your Script... (at least with the 'TAG' Mode..., it can be avoided with the 'EVENT' Mode...).

If your '#4:#5' Selection is done manually, then you can "do it" the other way around..., first let iMacros do the Selection for '#1:#3:#8', add a 'PAUSE' to your Script, and only then do the extra manual Selection with '#4:#5'.

If you "really" want to do everything from your Script, you could first try extracting (with 'EXTRACT=TXT') which Item(s) is/are already selected, and using 'EVAL()' to "reconstruct" the Full Selection...
But I'm not sure the 'EXTRACT' will work with multiple already selected Items, I think it only extracts the visible Item in the DDLB... (I've never tried...)
And reconstructing the Full Selection will be a bit "tricky" because the '#' Selector (= 'Select by Index' Selector) must be outside the Var(s), so you might hit some Limitations if your Nb of Items to select might be variable (sometimes 5, up to say 8, for example), then you might need to "hard-code" always selecting 8 Items, but if you only need 5 out of 8, I'm not sure how iMacros will "behave" with the last 3 "unnecessary" Items, if you repeat some Items or fake-try to select some fake '#99' Item...

I've never needed that "Functionality" for myself, so I've never tried..., and you are the first to ask on the Forum...
Provide the URL to your Site/Page, or to some "Public" Site containing such a Multiple Selection DDLB and I can have a Look..., and try as well a few other "Things" and "Tricks" that I didn't mention... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
lesha_01
Posts: 3
Joined: Fri Jul 20, 2018 7:46 am

Re: Multiple selection with considering previously selected

Post by lesha_01 » Fri Jul 20, 2018 12:37 pm

Thank you for the answer! Page is not in public access, so I can show only code of multiple selection form with preselected items (4 and 5):

Code: Select all

<select name="colorbody_multilov[]" multiple="multiple" size="10">
	<option value="beige">1</option>
	<option value="white">2</option>
	<option value="turquoise">3</option>
	<option value="bordo" selected="">4</option>
	<option value="bronze" selected="">5</option>
	<option value="lblue">6</option>
	<option value="yellow">7</option>
	<option value="green">8</option>
	<option value="golden">9</option>
</select>
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Multiple selection with considering previously selected

Post by chivracq » Fri Jul 20, 2018 1:47 pm

lesha_01 wrote:Thank you for the answer! Page is not in public access, so I can show only code of multiple selection form with preselected items (4 and 5):

Code: Select all

<select name="colorbody_multilov[]" multiple="multiple" size="10">
	<option value="beige">1</option>
	<option value="white">2</option>
	<option value="turquoise">3</option>
	<option value="bordo" selected="">4</option>
	<option value="bronze" selected="">5</option>
	<option value="lblue">6</option>
	<option value="yellow">7</option>
	<option value="green">8</option>
	<option value="golden">9</option>
</select>
Okay..., well, then you can try all the Suggs I mentioned, and if you need to go along the "extract previously selected Items and reconstruct the full Selection" way, if the 'EXTRACT=TXT' doesn't work to retrieve the 2x '#4:#5' Items already selected, those 2 are clearly visible in your Source and could be easily extracted from an 'EXTRACT=HTM' on the same DDLB + 'EVAL()' to isolate those 2 thanks to their 'selected' Attribute that the other Items do not have... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
lesha_01
Posts: 3
Joined: Fri Jul 20, 2018 7:46 am

Re: Multiple selection with considering previously selected

Post by lesha_01 » Fri Jul 20, 2018 1:52 pm

Thank you! I'll try to extract selected items and select them again :D
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Multiple selection with considering previously selected

Post by chivracq » Fri Jul 20, 2018 1:55 pm

lesha_01 wrote:Thank you! I'll try to extract selected items and select them again :D
Yeah, good luck..., and post your Final Script..., or if you get stuck..., though it will hard to help you "precisely" any further if I can't "play" with the Page myself... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply