I'm trying to learn how to send data back and forth using AJAX GET & POST. For my first test, I setup a simple email page on my server. I created a form to test that if I hit it with POST variables for username and password it will send me an email with that info. (I just needed some quick way to see if the POST variables are making it from my PRE to my server - maybe I'm wrong and you can't test it that way?)

Anyway - let's assume you can...

Here's the code I'm using. Can anyone give me advice on why I'm not getting the test email back after filling in the username/password in my test app?

login-assistant.jsjsjs
Code:
function LoginAssistant() {
	/* this is the creator function for your scene assistant object. It will be passed all the 
	   additional parameters (after the scene name) that were passed to pushScene. The reference
	   to the scene controller (this.controller) has not be established yet, so any initialization
	   that needs the scene controller should be done in the setup function below. */
	//  this.textString=text;
}

LoginAssistant.prototype.setup = function() {
	this.usernameAttr = {
	hintText: "Enter Username",
	focus: true
	};
	this.usernameModel = {
		value:""
	};
	this.controller.setupWidget("username",this.usernameAttr, this.usernameModel);
	
	// password setup
	this.passwordAttr = {
		hintText: "Enter Password",
		//focus: true
	};
	this.passwordModel = {
		value:""
	};
	this.controller.setupWidget("password",this.passwordAttr, this.passwordModel);
	Mojo.Event.listen(this.controller.get("SignInButton"),Mojo.Event.tap, this.loginHandler.bindAsEventListener(this));
}	

LoginAssistant.prototype.activate = function(event) {
	/* put in event handlers here that should only be in effect when this scene is active. For
	   example, key handlers that are observing the document */
	//  $("color").innerHTML=this.textString;
};

LoginAssistant.prototype.deactivate = function(event) {
	/* remove any event handlers you added in activate and do any other cleanup that should happen before
	   this scene is popped or another scene is pushed on top */
};

LoginAssistant.prototype.cleanup = function(event) {
	/* this function should do any cleanup needed before the scene is destroyed as 
	   a result of being popped off the scene stack */
};

LoginAssistant.prototype.loginHandler = function(event)
{
    // CHECK USERNAME & PASSWORD
    // MAKE AJAX LOGIN REQUEST

        if (this.usernameModel['value'] == '' || this.passwordModel['value'] == '')
        {
            Mojo.Controller.errorDialog('Please enter both your Username and Password!', this.controller.window);
            this.controller.get('login').mojo.deactivate();
        }
        else
        {
            // SET AJAX URL VARIABLE
            // CREATE HASH OF VALUES TO PASS TO WEB SERVER

                var loginAjaxURL = 'http://www.mywebsite.com/postcheck.php';

                loginAjaxParameters = new Hash();
                loginAjaxParameters.set('username', this.usernameModel['value']);
                loginAjaxParameters.set('password', this.passwordModel['value']);

            // SET AJAX ATTRIBUTES
            // MAKE AJAX REQUEST

                var loginAjaxAttributes =
                {
                        method: 'post',
                      evalJSON: 'true',
                    parameters: loginAjaxParameters,
                     onSuccess: this.loginAjaxSuccess.bind(this),
                     onFailure: this.loginAjaxFailure.bind(this)
                };

                var loginAjax = new Ajax.Request(loginAjaxURL, loginAjaxAttributes);
        }
}

LoginAssistant.prototype.loginAjaxSuccess = function(response)
{
    // GET DATA FROM JSON RESPONSE
    // TAKE ACTION BASED ON THE RESPONSE "STATUS"

        response = response.responseText.evalJSON(true);

        if (typeof(response.status) == 'undefined') {Mojo.Controller.errorDialog('There was an error logging into your account, please check your ionternet connection try again!', this.controller.window); this.controller.get('login').mojo.deactivate();}
        else
        {
            // SET LOCAL VARIABLES
            // DEACTIVATE BUTTON
            // PUSH NEXT SCENE BASED ON USER TYPE

                var userID        = response.userID;
                var userFirstName = response.userFirstName;
                var userLastName  = response.userLastName;

                this.controller.get('login').mojo.deactivate();
                this.controller.stageController.swapScene('yourScene');}
        }
Login-scene.html
Code:
<div class="my-splash-background">
<div class="palm-body-text">
	
    <div align=center>
<div id="headerspacer"></div>	

	 
<div class="palm-group">
	<div class="palm-group-title" align="left">
		Username
	</div>
	<div class="palm-list">  
		<div class='palm-row single'>
			<div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">
				<div class="title" align="left">
					<div id="username" x-mojo-element="TextField"></div>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="palm-group">  
	<div class="palm-group-title" align="left">
		Password
	</div>
	<div class="palm-list">
		<div class='palm-row single'>
			<div class="palm-row-wrapper textfield-group">
				<div class="title">
					<div id="password" x-mojo-element="PasswordField"></div>
				</div>
			</div>
		</div>
	</div>
</div>

 <button id="SignInButton">Sign in</button>
<br><br>


</div>
</div>
</div>