EasyUI Forum
May 15, 2024, 09:19:01 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How can pass extra data when submit a form  (Read 17103 times)
manojvijayan
Newbie
*
Posts: 13


View Profile Email
« on: December 27, 2012, 09:59:43 PM »

How can pass extra data which are not in the form when submit a form.Please see the example.

I want to pass extra data like  params:{product_id : '125','qnty':10,'price':500} instead of url:'page.php?product_id=125&qnty=10&price=500'' when submit a form


function submitForm(){          
                    
                        $('#ff').form('submit',{
             url:...,  
             params:{product_id : '125','qnty':10,'price':500}
            
         });  
}  
« Last Edit: December 27, 2012, 10:03:08 PM by manojvijayan » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 30, 2012, 08:29:50 PM »

Please download the updated form plugin from http://www.jeasyui.com/easyui/plugins/jquery.form.js and try the following code:
Code:
$('#ff').form('submit',{
url:..., 
onSubmit:function(param){
param.product_id = '125';
param.qnty = 10;
param.price = 500
}
}); 
Logged
andy
Newbie
*
Posts: 7


View Profile Email
« Reply #2 on: January 07, 2013, 10:12:37 PM »

I using this code and it's work.  Smiley

$.post('127.0.0.1/data_save',
{
   Code : $('#position_text_code').val(),               
   Name : $('#position_combogrid_name').combogrid('getValue'),
   Address : $('#position_text_address').val()
}, function(result)
{
      $("#loading").html();
      fcn_datagrid_loadData();
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!