Welcome Guest, Not a member yet? Register   Sign In
jquery modal passing post values to controller
#1

[eluser]gdawson[/eluser]
Let's begin by saying I am new to jquery. My issue is when I am using a jquery modal form, the post value is not being sent to the controller.

In the modal form, when clicking on "Submit Note", I am taken to the url in the form action, however the post value is not passed. Below is my simple code and any help is greatly appreciated.

I have been searching various postings but cannot figure this one out.

[removed]
Code:
$(function() {
                
  $( "#dialog-modal" ).dialog({
   height: 400,
                        width: 475,
   modal: true,
                        autoOpen: false,
                          buttons: {
                            "Submit Form": function() {
                                ($("input#newNote").val());
                                document.noteform.submit();
                            },
                            "Cancel": function() {
                                $(this).dialog("close");
                            }
                },
                close: function() {
                        allFields.val( "" ).removeClass( "ui-state-error" );
                }                        
            });

            $( "#create-note" )
   .button()
   .click(function() {
    $( "#dialog-modal" ).dialog( "open" );
   }
            );

HTML/php/Form:
Code:
<?php
$noteForm= array('name'  => 'noteform', 'id' => 'noteform');
?>

<button id="create-note">Add Note</button>

&lt;?= form_open('notes/addNote/', $noteForm) ?&gt;
<div id="dialog-modal" title="Add Note">

    &lt;input id="newNote" type="text" name="newNote" value="" /&gt;

&lt;?= form_close() ?&gt;


Messages In This Thread
jquery modal passing post values to controller - by El Forum - 07-30-2012, 05:44 PM
jquery modal passing post values to controller - by El Forum - 07-30-2012, 07:01 PM
jquery modal passing post values to controller - by El Forum - 07-31-2012, 02:59 PM
jquery modal passing post values to controller - by El Forum - 07-31-2012, 04:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB