Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8166281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:48:31+00:00 2026-06-06T19:48:31+00:00

I am trying to write a custom magento module and i’ve got it all

  • 0

I am trying to write a custom magento module and i’ve got it all complete and working perfectly except one problem.

The module is a form with 4 radio buttons. They are all blank on the checkout page and I have them set up so that when you click one it submits the form and reloads the cart page with the “additional fees” in the subtotal.

My problem is that I need the first option to “auto submit” on page load. But I’ve tried ALOT of different things and can’t come up with a way to use the jquery .submit() function to ONLY submit the form once. as it is now it works how I want it, except it loads the page in an endless loop.

Any way to say submit() only once?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:48:32+00:00Added an answer on June 6, 2026 at 7:48 pm

    I’d set the default radio button server-side rather than having an extra submit/refresh cycle, but if you insist on doing it client-side…

    I assume on subsequent refreshes the previous selection will be retained (because your server-side code echoes back the previously selected values?), so can you perhaps test whether any radios are checked and if not assume that that is the first and only time to auto-submit?

    $(document).ready(function() {    
        var $radios = $('#yourFormId input[name="yourRadioButtonGroupName"]');
    
        if (!$radios.is(":checked")) {
           // No radios currently checked, so check the first and submit
           $radios.eq(0).prop("checked",true);
           $("#yourFormId").submit();
        }
    });
    

    The .is() method will “Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a custom payment gateway for Magento. The module is recognised
I'm trying to write a converter class for custom types--converting one type (and all
While trying to write a custom control I've come across a problem with the
I'm trying to write a custom search that will search all categories and individual
I'm trying to write some custom logic for browsing and searching in a Magento
I'm trying to write custom authentication domain service. I think I understood all code
I'm trying to write a custom cmp function for a map, a simple one
I'm trying to write a custom powershell script that will create a local user
I am trying to write a custom tag. I can write attributes; however, I'm
I'm trying to write a custom rendering template for use in the DisplayForm of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.