-
3 Oct 2012 5:59 AM #11Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
Try this:
Code:submitContactForm: function(btn) { var form = btn.up('formpanel'); console.log(form); }Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Oct 2012 6:15 AM #12
Ok but what is wrong with the code written by me (in video it is working).
-
3 Oct 2012 6:18 AM #13
Thanks although you have solved my problem but i am still curious why code shown in the video is not working.
-
21 Nov 2012 4:47 AM #14
same question, why doesn't code work?
same question, why doesn't code work?
I changed to the new way of doing refs
and still get the error.Code:refs: { contactForm: '#contactForm' }
after looking around, I read that you have to place the refs inside a config
so i changed my code to
after that everything workedCode:config: { refs: { loginForm: '#loginForm' } },
-
22 Nov 2012 3:18 AM #15
Uncaught TypeError: Unexpected Token s
Uncaught TypeError: Unexpected Token s
hallo,
i make the same example and also had the same problem.
Thanks to you, now everything is ok, but i have a new problem.
How looks your contact.php?
I get the error message: "Uncaught TypeError: Unexpected Token s".
Do someone know why? :-(
is the Problem here: url:'contact.php'
Do i have to write it different?
thanks in advance
-
22 Nov 2012 12:30 PM #16
Hi Ades,
does the error happen after you do something (an event) or on load?
can you post your code?
also code of contact.php ?
-
23 Nov 2012 4:14 AM #17
Hallo Jonny,
thank you very much.
Now it's ok, because wrote in the contact.php:
<?php
$username = $_POST["username"];
$password = $_POST["password"];
if('test' == $username || '123' == $password){
$aRes = array('success' => true);
}
else{
$aRes = array('success' => false);
}
echo json_encode($aRes);
?>
and in the main class :
submitkontaktForm:function(btn){
var form=btn.up('formpanel');
form.submit({
url:'contact.php',
success : function(form, res){
console.log('right');
alert('Sie sind angemeldet');
},
failure : function(form, res){
console.log('false');
alert('false Login');
}
})
},
i just used different class-names, like the example in the video.
Everything is now ok, but i would like to say:
if the Login is true, so give me a view. I have a new View, but i can't create the view.
I wrote:
success : function(form, res){
//Ext.create is not working :-(
Ext.create("Anmeldung.view.Hauptseite");
console.log('right');
alert('Sie sind angemeldet');
},
it is not working :-(
Do someone now what can i do?
Thanks
-
27 Nov 2012 1:16 AM #18
ok it's working :
//------------------------------------------------------------------
submitkontaktForm:function(btn){
var form=btn.up('formpanel');
//console.log(form);
form.submit({
url:'login.php',
success : function(form, res){
console.log('right');
Ext.Viewport.setActiveItem(Ext.create('Login.view.Next'));
alert('you are logged in');
},
failure : function(form, res){
console.log('false');
alert('falscher Login');
}
})
},
//-----------------------------------------------------------------



Reply With Quote