If Checkbox is Checked if not Check it

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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.

If Checkbox is Checked if not Check it

by jramirez99 on Sun Sep 30, 2018 9:13 pm

All,

I have a question about how to check a box if its not check, if the box is check move on the next box. I know some scripting is needed. But I am unable to determine how to use the EXTRACT=CHECKED. Basically I want to loop through the check boxes if one isn't check, initiate the click to check the box.

any assistance will be greatly appreciated.

Code: Select all
var macro;
macro = "CODE:";
macro += "VERSION BUILD=1005 RECORDER=CR" + "\n"; 
macro += "URL GOTO=https://www.arise.com" + "\n"; 
macro += "" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm31" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm32" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm33" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm34" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm35" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm36" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm37" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm38" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm39" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm40" + "\n"; 
macro += "" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst17 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst18 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst19 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst20 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst21 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst22 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst23 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst24 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst25 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst26 CONTENT=YES" + "\n"; 
macro += "" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_btnSubmit" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:aspnetForm ATTR=ID:btnAlertOK" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:aspnetForm ATTR=ID:btnAlertOK" + "\n"; 
macro += "" + "\n"; 
iimPlay(macro);
jramirez99
 
Posts: 1
Joined: Sun Sep 30, 2018 9:01 pm

Re: If Checkbox is Checked if not Check it

by chivracq on Tue Oct 02, 2018 10:52 pm

jramirez99 wrote:All,

I have a question about how to check a box if its not check, if the box is check move on the next box. I know some scripting is needed. But I am unable to determine how to use the EXTRACT=CHECKED. Basically I want to loop through the check boxes if one isn't check, initiate the click to check the box.

any assistance will be greatly appreciated.

Code: Select all
var macro;
macro = "CODE:";
macro += "VERSION BUILD=1005 RECORDER=CR" + "\n"; 
macro += "URL GOTO=https://www.arise.com" + "\n"; 
macro += "" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm31" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm32" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm33" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm34" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm35" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm36" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm37" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm38" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm39" + "\n"; 
macro += "TAG POS=1 TYPE=A ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl01_lnkTm40" + "\n"; 
macro += "" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst17 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst18 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst19 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst20 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst21 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst22 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst23 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst24 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst25 CONTENT=YES" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_ucQkPstGrd_gdvPostings_ctl04_chkPst26 CONTENT=YES" + "\n"; 
macro += "" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_cphMain_btnSubmit" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:aspnetForm ATTR=ID:btnAlertOK" + "\n"; 
macro += "TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:aspnetForm ATTR=ID:btnAlertOK" + "\n"; 
macro += "" + "\n"; 
iimPlay(macro);

Hum, interesting Use of "I know", => But...!, I'm not sure People stating "I know" ever get an Answer on Technical Forums, just saying... :idea:
=> "I know" (just as an Example :wink: ), that you didn't read the Forum Rules... :oops:
(Mini-Hint: Your FCI is completely unclear, read my Sig... (+ the Forum Rules of course...!))
- (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: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: If Checkbox is Checked if not Check it

by chivracq on Sat Oct 06, 2018 10:36 pm

Hum, I thought you were going to post an Update, starting with your FCI of course, as I saw you were checking the Forum a bit earlier..., but nope... :(

Hum, OK..., I guess mentioning 3 Versions about your Config was probably already too "complicated", oh well..., fair enough... 8)
(But don't expect "too much" from iMacros in that case, I'm "afraid" you won't really be able to understand what it is meant for and how to "use" it a bit "properly" and "creatively", just saying...! :roll: )
- (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: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: Majestic-12 [Bot] and 8 guests

-->