EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
September 14, 2025, 03:35:48 AM
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
>
globally replace all occurences before onBeforeSubmit
Pages: [
1
]
« previous
next »
Print
Author
Topic: globally replace all occurences before onBeforeSubmit (Read 7415 times)
devnull
Sr. Member
Posts: 431
globally replace all occurences before onBeforeSubmit
«
on:
April 07, 2015, 09:49:56 PM »
How can I globally replace all occurrences of a single quote with 2 single quotes before submitting a form.
I cannot use the existing events as they are all being used for other things, I need to be able to do this to all form submissions whilst leaving the existing events intact.
What I need is a onBeforeSubmit event that can be set to globally do the replacements.
Maybe this can be done at the ajax level where the form() calls the jquery ajax function ?
Thanks
edit
===
Could $.ajaxPrefilter() somehow be used to do this ?
«
Last Edit: April 07, 2015, 09:54:17 PM by devnull
»
Logged
-- Licensed User --
stworthy
Administrator
Hero Member
Posts: 3581
Re: globally replace all occurences before onBeforeSubmit
«
Reply #1 on:
April 08, 2015, 08:15:55 AM »
The 'onSubmit' event fires before submitting a form. You can add additional field but can not override an existing field.
Code:
$('#ff').form({
onSubmit: function(param){
param.f1 = ...
param.f2 = ...
}
});
Logged
devnull
Sr. Member
Posts: 431
Re: globally replace all occurences before onBeforeSubmit
«
Reply #2 on:
April 08, 2015, 04:01:56 PM »
Hi;
I cannot use the onsubmit event as that event is already being used, and I would need to add code to every single form and there are jost too many to do that.
I am looking to do this globally, to apply to every form submission without disturbing the existing events.
Thanks
Logged
-- Licensed User --
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...