#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,246
    Rep Power
    220

    .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,110
    Rep Power
    4103
    #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

IMN logo majestic logo threadwatch logo seochat tools logo