Yep, in the console in FF looks everything allright.
On the answer tab there is: {"error":true,"message":"Sorry, this email already existed"}
So it got the right response but how get I this is an javascript alert as a popup or inline in the app?
Yep, in the console in FF looks everything allright.
On the answer tab there is: {"error":true,"message":"Sorry, this email already existed"}
So it got the right response but how get I this is an javascript alert as a popup or inline in the app?
Hi Koning,
You have this:
pre
I have put this javascript in Pages -- signup -- Data tab -- Component: login, Event: Error, Action: Run javascript, Details: your javascript
/pre
But we've suggested your "success" event handler instead of "error".
Please try it.
If you still will have this problem after trying "success" please give us your app public link and describe steps to reproduce this problem.
Regards.
Hi,
You are right, you suggested Success but I have tried that one and try to use Error instead but both events doesn't work.
With the event Success the spinner is going round and round with no ending.
In the Console in Firefox I get :
Object { error=true, message="Sorry, this email already existed"}
That's look OK as a response because I use an excisting e-mail address
TypeError: data.response is undefined
console.log(data.response.message);
Probebly this is the problem?
With the app public link you mean the url which I have in the browser when testing the app?
This is http://appery.io/app/mobile-frame?src...
Kind regards,
Arie
Hi Koning,
Ok, in this case you have some other response, and you need to use following code:
pre
//print all response to the console.
console.log(data);
//print "data.error" to console.
console.log("is error = " + data.error);
//print "data.message" to console.
console.log("is error = " + data.message);
//Here you use data object in accordance to your needs.
/pre
Regards.
OK, this is working fine now.
I have an alert to show the response:
alert(data.message);
But how can I get this response in a label field which has default no text but will be filled with the response messages. I tried
$('label[name=label_response_aanmaken_account]').val(data.message);
But the label doesn't show the response text.
Or does I need to use a text aerea in stead of a label to get this done?
Any idea what I'm doing wrong?
Kind regards,
Arie
Hi Koning,
Here is correct code for your goal:
pre
//Note: you should replace "label_response_aanmaken_account" with your label component name.
Appery("label_response_aanmaken_account").text(data.message);
/pre
Regards.
Tnx, it's working now!
This was a free solution and it worked well for you? Can you share any Pages, plugins, or services code with others?
Yep it works fine for me.
The API with documentation / examples is found here : http://www.androidhive.info/2014/01/h...
Success with your implementation!