Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2014
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to SUBMIT instead of CLICK

    ​Basically I am writing this code in javascript/tampermonkey and its navigating a website. The part im stuck at is a submit type link. For the other links you use:

    document.getElementId("addToCartLink").click()

    for it to click on it. The code for that link that the above code is "clicking" is:

    <a id="addToCartLink" href="javascript:addToCart()" onclick="showBubble(this)" onmouseout="hideBubble()"><span>Add to Cart</span></a>.

    well now I want to create a code that clicks:

    <input title="Add To Cart" name="pdp_addtocart" value="Add To Cart" type="submit" class="active_step">

    ​but i cant get anything to work. If you could share this with you or one of your friends that are good at coding could help me out that would be Awesome!

    Thanks,
    Devante

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    I supposed .click() also works in submit buttons but if not, you can simply submit the form. I assume there is only one submit button on the form?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • Users who have thanked glenngv for this post:

    devantecb (03-05-2014)

  • #3
    New to the CF scene
    Join Date
    Mar 2014
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes there is. What is the coding for that?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •