EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 21, 2024, 05:35:33 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
submit a form using linkbutton
Pages: [
1
]
« previous
next »
Print
Author
Topic: submit a form using linkbutton (Read 9214 times)
crosemffet
Jr. Member
Posts: 68
submit a form using linkbutton
«
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
Re: submit a form using linkbutton
«
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
Re: submit a form using linkbutton
«
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
Re: submit a form using linkbutton
«
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...