Welcome Guest ( Log In  ·  Register)



 
Reply to this topicStart Poll
Frontend question
[ Standard ] · Linear+
IamGroot
post Sep 25 2023, 07:48 AM
Post #1


Lieutenant
Group Icon

Group: Members
Posts: 501
DOW II Replays: 0
Submissions: None
Joined: 30-March 21

Member No.: 125,269






There is a checkbox on a website. This URL lists 1 category.

https://example.com/example.php?pid=example&tag_categories=A

But I want to open multiple categories. I call them A, B, C and D. How can I do this?

I am only a user, the website isn't mine. I need an URL to create a bookmark.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
LNC_GoldenAxe
post Sep 25 2023, 09:58 AM
Post #2


Lieutenant-General
Group Icon

Group: Members
Posts: 3,429
DOW II Replays: 0
Submissions: None
Joined: 10-April 12

From: Earth
Member No.: 110,172






Is the checkbox a category?

Do you want to add multiple categories, as in multiple checkboxes?
Do you have access to the website code? so you want a javascript button to create a bookmark?

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
IamGroot
post Sep 25 2023, 10:24 AM
Post #3


Lieutenant
Group Icon

Group: Members
Posts: 501
DOW II Replays: 0
Submissions: None
Joined: 30-March 21

Member No.: 125,269






QUOTE(LNC_GoldenAxe @ Sep 25 2023, 03:58 PM)
Is the checkbox a category?

Do you want to add multiple categories, as in multiple checkboxes?
Do you have access to the website code? so you want a javascript button to create a bookmark?
*


There are checkboxes on a website. I am lazy to check them again and again and I want to make an URL which checks them automatically.

One key, more values.
(IMG:https://static.semrush.com/blog/uploads/media/ca/37/ca3737d8edb5cf079aaf1f11ae01d286/mMREmiwXSrryVyv8IxbVFgje7ICFhfqWnca7W0db36KjX35vzLTnStkFynEd9NBoXXH-JYKCm2deskxgLo_vxzEvl-qLpVOgtwc78rhFI2Rm1pBK-j2SwMKWz0CXU42STjzUVcF1vaRTFbw_6wvH_5A.png)

I see only the view-source: page with the browser.

About a year ago I tried to make scripts with greasemonkey. It checked the checkboxes, but the website didn't list the items, it needed manual click. However the url method above works, but I can select only one single category. I can select more categories with manual clicking,

This post has been edited by IamGroot: Sep 25 2023, 10:31 AM

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
LNC_GoldenAxe
post Sep 25 2023, 11:42 AM
Post #4


Lieutenant-General
Group Icon

Group: Members
Posts: 3,429
DOW II Replays: 0
Submissions: None
Joined: 10-April 12

From: Earth
Member No.: 110,172






The only way that querystring url will work is if that website is expecting a querystring URL.

The website can have javascript or codebehind (.net, Java, etc) that is checking the URL for params and then checking the checkboxes for you.

This post has been edited by LNC_GoldenAxe: Sep 25 2023, 11:44 AM

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
IamGroot
post Sep 25 2023, 12:21 PM
Post #5


Lieutenant
Group Icon

Group: Members
Posts: 501
DOW II Replays: 0
Submissions: None
Joined: 30-March 21

Member No.: 125,269






QUOTE(LNC_GoldenAxe @ Sep 25 2023, 05:42 PM)
The only way that querystring  url will work is if that website is expecting a querystring URL.

The website can have javascript or codebehind (.net, Java, etc)  that is checking the URL for params and then checking the checkboxes for you.
*


Yeah, seems like URL method won't work.
Javascript should click to trigger a fire event, not just check, but it would be too difficult on the site I want to use. I give up.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
IamGroot
post Dec 6 2023, 10:38 AM
Post #6


Lieutenant
Group Icon

Group: Members
Posts: 501
DOW II Replays: 0
Submissions: None
Joined: 30-March 21

Member No.: 125,269






I created javascript, which clicks automatically:
CODE
function checkthemall1() {
 document.querySelector("input[type='checkbox'][value='VIDÉK']").click();
}


But there is a problem. When the checkbox is checked, I don't want to click, because it removes the tick. When the checkbox is checked there is a
CODE
checked='checked'
on the code. How can I exclude this from the queryselector above?

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
IamGroot
post Dec 6 2023, 10:53 AM
Post #7


Lieutenant
Group Icon

Group: Members
Posts: 501
DOW II Replays: 0
Submissions: None
Joined: 30-March 21

Member No.: 125,269






Ok, it's ready.
CODE
setTimeout(checkthemall1, 1000);

function checkthemall1() {
 document.querySelector("input[type='checkbox'][value='VIDÉK']:not([checked='checked']").click();
}

It took me almost a year to solve this simple problem.



User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicTopic Options
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
 

Task


Time is now: 1st March 2024 - 02:07 AM
About Us  ·   Advertising  ·   Contact Us  ·   Terms of Use  ·   Privacy Policy