#1
  1. A Change of Season
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,558
    Rep Power
    221

    .submit(); Not working


    Hi;

    This alerts "Should submit now" and changes the action but it doesn't submit.

    Code:
    function change_form_action_for_coupon(new_action)
    	{
    		$('#usps').attr('action', new_action);
    		$('#usps').submit();
    		alert('Should submit now');
    	}
    What's am I missing?

    Thanks
  2. #2
  3. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,271
    Rep Power
    4193
    #usps refers to a <form> tag, correct? console.log($('#usps')[0]) and check. console.log(new_action) to make sure it's a valid value.

    I've used $form.submit() a number of times to trigger a submission so it does work in general.
    Recycle your old CD's



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Location
    India
    Posts
    2
    Rep Power
    0
    Can you show me your forms tag code?

IMN logo majestic logo threadwatch logo seochat tools logo