EasyUI Forum
May 21, 2024, 05:35:33 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: submit a form using linkbutton  (Read 9214 times)
crosemffet
Jr. Member
**
Posts: 68



View Profile WWW Email
« on: December 03, 2012, 07:59:04 AM »

this is the code for the submit process:
$('#mainForm').form({
   onSubmit: function(){
      return $(this).form('validate');
   },
   success:function(data){
      $.messager.alert('Info', data, 'info');
   }
})
server response is: "OK"
the problem is:
if the submit button is:
<input type="submit" value="Submit">
then the alert message shows ok, but if the submit button is:
<a href="#" class="easyui-linkbutton" onClick="$('#mainForm').form('submit');">submit</a>
the submission process works ok, but the alert message response is never shown....
any reason...? what's wrong with my submission button...?
« Last Edit: December 03, 2012, 08:02:57 AM by crosemffet » Logged
mzeddd
Full Member
***
Posts: 223



View Profile
« Reply #1 on: December 03, 2012, 10:29:29 AM »

Hi,

Try to do in this way

Code:
<a href="#" class="easyui-linkbutton" onClick="mainForm.submit();">submit</a>
Logged
crosemffet
Jr. Member
**
Posts: 68



View Profile WWW Email
« Reply #2 on: December 03, 2012, 10:39:19 AM »

mzeddd, tanks you for your reply, but unfortunately your solution is not working.
if I use onClick="mainForm.submit();", it skips the whole validation process and the form is submitted without check the require fields, number fields, etc.
any other idea..?
Logged
crosemffet
Jr. Member
**
Posts: 68



View Profile WWW Email
« Reply #3 on: December 03, 2012, 11:00:36 AM »

finally find the solution by myself:
onClick="$('#mainForm').submit();"
do the trick ! .
thanks all for your support,
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!