How do I set the Select All “checkbox” iMacros Without using the button “Play (Loop)”

牧云@^-^@ 提交于 2019-12-13 08:01:13

问题


How do I set the Select All "checkbox" iMacros Without using the button "Play (Loop)" and without making the tag to 50 lines since our site I visited was no key select all and I need to choose 50 categories. Here's the code that I use and try

This version javascript Imacros:

var macro;
macro =  "CODE:";
macro +=  "TAG POS={{i}} TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES" + "\n"; 
macro +=  "WAIT SECONDS=0" + "\n"; 
for(i=1;i<=50;i++){
iimSet("i",i);
iimPlay(macro);
}

This version Imacros

TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=2 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=3 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=4 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=5 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=6 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=7 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=8 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=9 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
TAG POS=10 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES
---------
TAG POS=50 TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES

I want is just one line version of iMacros


回答1:


Maybe this could help you:

URL GOTO=javascript:{var<SP>chkBoxes=document.getElementsByName("category[]");for(i=0;i<chkBoxes.length;i++)chkBoxes[i].checked=true;undefined;}



回答2:


You try

SET !LOOP 50
TAG POS={{!LOOP}} TYPE=INPUT:CHECKBOX FORM=ID:post_form ATTR=NAME:category[] CONTENT=YES


来源:https://stackoverflow.com/questions/30608734/how-do-i-set-the-select-all-checkbox-imacros-without-using-the-button-play-l

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!