Hi Guys
Im trying to write a little piece of code to stop the submit button of a form
be active until the form fields have been completely filled in, its a really
simple for consisting of 1 form field and 1 checkbox, ive had a go at writing
some code of my own but for some reason flash quits on export.
Whats wrong with my code?
What do you think could be causing it to crash?
here is my stab at it...
submit_btn.useHandCursor = false;
submit_btn.mouseEnabled = false;
submit_btn.addEventListener(MouseEvent.CLICK, submit_btn_CLICK);
this.addEventListener(Event.ENTER_FRAME, ENTERFRAME);
function ENTERFRAME(ev:Event):void
{
if((mobileNumber.text != "") || (mobileNumber.text != NaN) ||
(mobileNumber.text != undefined) && (terms.selected != false)){
submit_btn.useHandCursor = true;
submit_btn.mouseEnabled = true;
}else{
var frame:int = 0;
trace("EnterFrame"+(frame+));
}
}
function submit_btn_CLICK(ev:Event):void
{
var url:String = "formSubmit.php";
var request:URLRequest = new URLRequest(url);
var variables:URLVariables = new URLVariables();
variables.mobile = mobileNumber.text;
request.data = variables;
request.method = URLRequestMethod.POST;
try {
navigateToURL(request, "_blank");
}
catch (err:Error) {
trace(err);
}
}
Thanks
SJM
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders