0

I have a basic form that includes 3 submit buttons.

<form action="/signups/wizard/location" id="SignupForm" method="post" accept-charset="utf-8">
<div style="display:none;"><input type="hidden" name="_method" value="POST"></div>
Street: <input name="data[Location][street]" maxlength="200" type="text" value="">
Apartment: <input name="data[Location][apartment]" value="">
City:<input name="data[Location][city]" maxlength="50" type="text" value="">
<div class="submit">
    <input name="Previous" type="submit" value="Previous">      
    <input type="submit" value="Continue">
    <input name="Cancel" type="submit" value="Cancel">  
</div>
</form>

When I submit that form, I expected the input fields for submit buttons to pass their data to $_POST, however I only see Location in the array.

Here are $_POST's contents:

array(
    '_method' => 'POST',
    'data' => array(
        'Location' => array(
            'street' => '',
            'apartment' => '',
            'city' => ''
        )
    )
)

UPDATE I disabled javascript and the values appear in $_POST. Is there an easy way to determine what script could be removing this?

1 Answer 1

1

Found the culprit, this JavaScript was included on every page by a previous developer.

$('form').submit(function(){
  $('input[type=submit]', this).attr('disabled', 'disabled');
});
Sign up to request clarification or add additional context in comments.

1 Comment

Arg! Just did exactly the same thing! Thanks for posting your solution :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.