Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
afterSubmit event
21/12/2009
19:31
Avatar
gvnsbt
Member
Members
Forum Posts: 17
Member Since:
12/12/2009
sp_UserOfflineSmall Offline

I read docuemntation about afterSbmit event but I did not understand howto to manage the output result script of server.

For example, when I add a record the editurl cgi is ivoked and I can see ( in php script, that in the _REQUEST (alway) and in the _POST or _GET array (mytype parameter)) the operation request (add, search, del ecc.).

The afterSubmit has the return call with success message and id variable. How can I to connect the output cgi (editurl parameter) with afterSubmit?

I wish I could manage and to view the return message of editurl script  in the form. Exmple : "Record inserted without errors" or

"Record not inserted ID already in archive", ecc.

Thanks in advance.

Giovanni.

22/12/2009
11:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

afterSubmit : function (resp, postdata)

{

// you should return from server OK in sucess, any other message on error

if(resp.responseText == "OK")

{

alert("Update is succefully")

return [true,"",""]

}

else {

alert("Update failed")

return [true,"",""]

}

}

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

31/12/2009
18:58
Avatar
shah
Member
Members
Forum Posts: 26
Member Since:
30/12/2009
sp_UserOfflineSmall Offline

Tony,

This is good, but how would i display the success message on the form itself and not a pop-up also i want to stay on the form after submit button is pressed.

Best Regards and a Happy new year! Cool

- Shah

03/01/2010
19:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Sorry not possible for now. What I do common in my applications is to call a custom function on succes whisc displays the message at bootom top screen for some time and the disappear.

Look here to have a idea:

http://jqueryui.com/demos/effect/

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

08/01/2010
00:38
Avatar
gvnsbt
Member
Members
Forum Posts: 17
Member Since:
12/12/2009
sp_UserOfflineSmall Offline

Hello,

 when, for example,  I submit the data from edit form, the editurl script can return the "OK" string, or a message error.

afterSubmit : function (resp, postdata)

{

// you should return from server OK in sucess, any other message on error

var message = resp.responseText

if(message == “OK”)

return [true,"",""]

else 

return [false, message, ""]

}

If I have a message error the form remains in open state and I can read on the top of form the message error, change the data and submit the data to server again.

If I have not error the form is clean, the main grid is update  and I can do other operations.

Regarsd.

Giovanni.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
63 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information