EasyUI Forum
December 14, 2024, 03:44:18 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: Adding custom data to a form  (Read 14911 times)
peter
Newbie
*
Posts: 10


View Profile
« on: April 10, 2012, 03:35:53 AM »

I have a form and I need to send extra data with the form.
The data to be sent is a complex structure, so using a hidden input element
in the form isn't going to be enough.

I had a look at the form plugin, and there is a reference to "data".
I tried adding it with 'data' as shown, but that doesn;t work.

 $(formId).form('submit',{ 
   url: url,
        data: {xxx: 'yyy'},
        onSubmit: function(){ 
            return $(this).form('validate'); 
        }, 
        success: function(result){ 
 ...

Thanks,

Peter
Logged
Kevin
Jr. Member
**
Posts: 52


View Profile Email
« Reply #1 on: April 13, 2012, 04:10:38 PM »

Hi Peter

I've done something similar but I just sent this data as part of the url post. ie.

url = 'PHP/update_data.php?part=0&user=1001&status='+row.status;

The framework will append your form data to this. Of course, if your data is a lot more complexed, you could send a $.post after receiving a success to your form data.
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!