Forum



07:16

14/09/2010

I see others asking same question, but no answer I found in their threads posted.
PROBLEM: DISPLAY MESSAGE ON FORM (FORM EDITING) IF *SUCCESS OR FAILURE* IN SERVER RESPONSE.
Like doc says, if afterSubmit return true, message is NOT displayed. WHY??? We MUST have message on form for success,
Maybe jQuery selector is wrong below?
afterSubmit: function (resp, pdata) {
var m = resp.responseText.split(':');
$('bottominfo').text(m[1]); // <=== PUT MESSAGE ON FORM *REGARDLESS* OF SUCCESS/FAILURE.
return(m[0] == 'true' ? true : false, m[1], m[2] != undefined ? m[2] : null); // <== RETURN MESSAGE EVEN WHEN SUCCESS, BUT NEVER DISPLAYS (AS DOC SAYS IT WILL NOT IF RETURNING TRUE....AGAIN, WHY???)
}
Thanks in advance for help.
07:57

14/09/2010

We find our answer, but not sure why it didn't work.
Another page in our app DID update .bottominfo on success.
We compare the two, and found no difference other than order of setting parameters prior to display form.
Debugging in browser showed no errors of any kind, working or non-working page.
We copy working page to non-working and just have to close this.
Sorry, we cannot debug it to find out our time must go on our app.
08:48

14/09/2010

Sorry to post we have a solution so quick. We do not.
Bottominfo never displays message even when successful, e.g.
afterSubmit: function(response, postdata) {
var ss = response.responseText.split(':');
var tf = (ss[0] == '1') ? true : false; $('.bottominfo').text(ss[1]); <== We want "Item successfully created". How??? var newid = (ss[2] != undefined) ? ss[2] : null; return [tf, ss[1], newid];
}
09:13

14/09/2010

We find the side-effect.
bottominfo has to be > 1 length set when create form:
bottominfo: ' ' // <=== at least one space.
if zero-length, e.g.
bottominfo: '' // <=== zero-length string, but sets it in DOM bottominfo. If not in initilialize, then not in DOM, then never works.
For sake of community we post our find.
Most Users Ever Online: 715
Currently Online:
59 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66