Jump to content
Sign in to follow this  

Buttons unregonized with ajax

Recommended Posts

So the forms with buttons seem to go unregonized by the modules.

<button type="submit" name="submit" value="true" class="btn">Update</button>


The Ajax:

  jq("#php__container").on('submit', 'form', function(e){
      var url = jq(this).attr("action");
        type: "POST",
        url: url,
        data: jq(this).serialize(), 
        success: function(data)
           // show response from the php script.
    return false;

$this->methodData->submit will always be empty. Every other fo element will have it's value. Anyone got any ideas on what's going on?

Share this post

Link to post
Share on other sites

Take a look at the documentation: https://api.jquery.com/serialize/

> Note: Only "successful controls" are serialized to the string. No submit button value is serialized since the form was not submitted using a button. For a form element's value to be included in the serialized string, the element must have a name attribute. Values from checkboxes and radio buttons (inputs of type "radio" or "checkbox") are included only if they are checked. Data from file select elements is not serialized.

Share this post

Link to post
Share on other sites
Posted (edited)

"since the form was not submitted using a button". The form does getting submitted using a button.


Now I get to pick on yo for giving me wrong URL:


Edited by Sim

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...