Jump to content

Form submission: Runs automatically when submit button hasn't been pressed


halben

Recommended Posts

I have the following: 

.. This is the button with hidden type ..

<input type="hidden" name="s2member_pro_paypal_registration[nonce]" id="s2member-pro-paypal-registration-nonce" value="xxx">
<input type="hidden" name="s2p-option" value="">
<input type="submit" name="r_submit" id="s2member-pro-paypal-registration-submit" class="s2member-pro-paypal-submit s2member-pro-paypal-registration-submit" value="Register" tabindex="1000">

My code to detect the submit button:

if (!isset($_POST['r_submit']) && $_POST['s2member_pro_paypal_registration']['nonce'] == 'xxx') {
    // Do nothing
} else {
    var_dump($something);
    // Do something
}

My site spits out 

var_dump()

 automatically when the form hasn't been submitted yet and I'm not sure why.

 

Can someone please help me?

 

Thanks,

Hal

Figured it out. I had to use the hidden type instead of the button name. It's weird. For the plugin, I had to custom insert a button name value so when the submit button has been pressed, it could read it. But for some reason, it wasn't reading the name value from the button.

 

Thanks for helping.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.