Selecting multiple checkboxes from a csv file

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Re: Selecting multiple checkboxes from a csv file

by chivracq on Tue Dec 26, 2017 12:15 pm

JKI wrote:Thank you for your response and time, I hope you had a nice Holiday weekend.

This is the code when clicking on the 7 labels like suggested
=> If you can record clicking on those 7 Labels

Code: Select all
TAG POS=1 TYPE=TD ATTR=ID:feature_SnglFam-Detached_label
TAG POS=1 TYPE=TD ATTR=ID:feature_SnglFam-Attached_label
TAG POS=1 TYPE=TD ATTR=ID:feature_Duplex_label
TAG POS=1 TYPE=TD ATTR=ID:feature_Triplex_label
TAG POS=1 TYPE=TD ATTR=ID:feature_Stories_label
TAG POS=1 TYPE=TD ATTR=ID:feature_Measured_label
TAG POS=1 TYPE=TD ATTR=ID:feature_TaxRoll_label


Any thoughts on where to go from here? If you've already dealt with this in other threads if you wouldn't mind linking them I will try to learn from them.

Hum, OK..., so when clicking on a Label, only the 'TAG' Statement for the Label gets recorded...
Usually the Label is "linked" to its corresponding CB and iMacros automatically records the (Toggle) Select/Deselect of the CB.
But when clicking on a Label, does the CB get automatically selected or not...?

And I asked how will you have your Data in the '.CSV'...?
If you have it as "SnglFam-Detached" / ... / "Duplex" / ... / "TaxRoll", then you can use:
Code: Select all
TAG POS=1 TYPE=TD ATTR=ID:feature_{{!COL1}}_label
... to uniquely tag a Label.
And if the CB gets automatically selected from a Click on the Label, then that should do the "Trick"...!

If the CB doesn't get automatically selected from a Click on its Label, then you'll need to use Relative Positioning like:
Code: Select all
TAG POS=1 TYPE=TD ATTR=ID:feature_{{!COL1}}_label
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_* CONTENT=YES

But...!, BUT-BUT-BUT...!, there is a chance, this will actually select the previous CB in the List and not the one that you exactly want. You would then need to use "Double Relative Positioning" like:
Code: Select all
TAG POS=1 TYPE=TD ATTR=ID:feature_{{!COL1}}_label
TAG POS=R-1 TYPE=* ATTR=*
TAG POS=R1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_* CONTENT=YES

... or:
Code: Select all
TAG POS=1 TYPE=TD ATTR=ID:feature_{{!COL1}}_label
TAG POS=R1 TYPE=* ATTR=*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_* CONTENT=YES

And the 'POS=R1' or 'POS=R-1' might maybe even become 'POS=R2' or 'POS=R-2' in your Case because of the 1/3/5/7... Sequence for the CB's on that Page, you'll need to experiment a bit yourself with the Values to get the desired Behaviour...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6966
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Selecting multiple checkboxes from a csv file

by chivracq on Tue Dec 26, 2017 12:39 pm

Hum..., if (Single) Relative Positioning like in:
Code: Select all
TAG POS=1 TYPE=TD ATTR=ID:feature_{{!COL1}}_label
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_* CONTENT=YES
... doesn't work, and you would then need to use Double Relative Positioning..., there might then be a simpler Solution, still using Single Relative Positioning with:
Code: Select all
TAG POS=1 TYPE=TD ATTR=ID:feature_{{!COL1}}_label
TAG POS=R1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_* CONTENT=YES

This will actually select the CB's with Even Numbers from 2/4/6/8/... that I suspect are Hidden but 'id_2' will probably do the same "Job" like 'id_1'.

Lots of "if-if-if" as I cannot do any Testing myself on the Page...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6966
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Selecting multiple checkboxes from a csv file

by JKI on Thu Dec 28, 2017 9:34 am

So after experimenting for a while I realized that clicking the label closer to the left of the field actually does do two things. It selects the label as well as the checkbox in one click. Here is the corresponding code. I haven't made any progress yet, does this change anything?

TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_1
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_1 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_3
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_3 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_19
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_19 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_21
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_21 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_65
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_65 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_67
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_67 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_69
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_69 CONTENT=YES
JKI
 
Posts: 8
Joined: Wed Nov 09, 2016 1:49 pm

Re: Selecting multiple checkboxes from a csv file

by chivracq on Thu Dec 28, 2017 11:38 am

JKI wrote:So after experimenting for a while I realized that clicking the label closer to the left of the field actually does do two things. It selects the label as well as the checkbox in one click. Here is the corresponding code. I haven't made any progress yet, does this change anything?

Code: Select all
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_1
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_1 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_3
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_3 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_19
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_19 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_21
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_21 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_65
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_65 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_67
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_67 CONTENT=YES
TAG POS=1 TYPE=LABEL FORM=ID:inputform ATTR=ID:lbl_69
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:inputform ATTR=ID:i_69 CONTENT=YES

Ah, OK...!, good, exactly like I was saying at/from the beginning..., but hum..., those "parallel" Labels use the same incremental 1/3/5/etc ID's like the CB's, so you cannot use them "directly" "like that" either, you need to check if they have some other Attribute(s) like 'NAME' would be my best guess..., that will use "Duplex" etc..., or again like I already mentioned, you need to use (Double...?) Relative Positioning... Did you try that...? :?:

And you didn't answer..., me asking twice already..., how (do) you "make" your Selection in your '.CSV'...?

You'll need to find the/a "Solution" by yourself as I cannot have a look at the Page myself, Grrr...!! :(
Maybe an Idea if you uploaded an 'HTML Saveas' of that Page to your Thread if you can't come out by yourself..., there is honestly nothing really "complicated" if you understand the "Principle", and I've given you absolutely all Guidelines..., it would take me a few Seconds (hum OK..., a few Minutes maybe if I want to test a few times that it works correctly indeed...) to get your Script working, would be more efficient I think than trying to explain "Things" that I have the "Feeling" you don't really catch, ah-ah..! :wink:
(Needs to be zipped, max 256Kb. Or to your Google Drive if you prefer or if it's >256Kb...) :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6966
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Previous

Return to iMacros for Firefox

Who is online

Users browsing this forum: No registered users and 7 guests

-->