Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-28-2009, 07:32 PM   PM User | #1
xiaodao
Regular Coder

 
Join Date: Sep 2004
Posts: 713
Thanks: 6
Thanked 2 Times in 2 Posts
xiaodao is an unknown quantity at this point
jquery help

I am using boxy for this pop up register form, however the ajax no working, it does not post to "user.php" nothing happens except an long array append to my index.php like "index.php?username=&userpass=&cpass=&useremail=&name=&phone=&address=&postal=&do=ajaxRegister&submi t=Register+Now"

my code
Code:
	$('#register').click(function(){
		var boxy_content;
		boxy_content += "<form id=\"registerform\" class=\"formular\"><fieldset>";
		boxy_content += "<label><span>Username: </span><input id=\"name\" name=\"username\" type=\"text\" class=\"validate[required,custom[noSpecialCaracters],length[0,20],ajax[ajaxUser]]\" size=\"20\" /></label>";
		boxy_content += "<label><span>Password: </span>	<input id=\"pass\" name=\"userpass\" type=\"password\"  class=\"validate[required,length[6,11]] text-input\" size=\"20\" /></label>";
		boxy_content += "<label><span>Confirm Password: </span><input id=\"cpass\" name=\"cpass\" type=\"password\"  class=\"validate[required,confirm[password]] text-input\" size=\"20\" /></label>";
		boxy_content += "<label><span>Email:</span><input id=\"email\" name=\"useremail\" type=\"text\" class=\"validate[required,custom[email]] text-input\" size=\"20\" /></label>";
		boxy_content += "<label><span>Name: </span><input id=\"name\" name=\"name\" type=\"text\" size=\"20\"  class=\"validate[optional,custom[onlyLetter],length[0,100]] text-input\"/></label>";
		boxy_content += "<label><span>Phone: </span><input id=\"phone\" name=\"phone\" type=\"text\" size=\"20\"  class=\"validate[required,custom[telephone]] text-input\" /></label>";
		boxy_content += "<label><span>Address : </span><input id=\"subject\" name=\"address\" type=\"text\" class=\"validate[required]] text-input\" size=\"20\" /></label>";
		boxy_content += "<label><span>Postal Code : </span><input id=\"subject\" name=\"postal\" type=\"text\" class=\"validate[required]] text-input\" size=\"20\" /></label>";
		boxy_content += "<input type=\"hidden\" name=\"do\" value=\"ajaxRegister\" /><input type=\"submit\" name=\"submit\" class=\"buttonSubmit\" value=\"Register Now\" /></fieldset>";
		boxy_content += "</form>";
		registerBoxy = new Boxy(boxy_content, {
		    title: "Register As A Member",
		    draggable: false,
		    modal: true,
		    behaviours: function(c) {
				c.find('#registerform').submit(function() {
					Boxy.get(this).setContent("<div style=\"width: 300px; height: 300px\">Sending...</div>");
					// submit form by ajax using post and send 3 values: subject, your_email, comment
					$.post("user.php", $('#registerform').serialize(),
                    function(data){
                        /*set boxy content to data from ajax call back*/
                        registerBoxy.setContent("<div style=\"width: 300px; height: 300px\">"+data+"</div>");
                    });

					return false;
				});
		    } 
		});
		return false;
	});
another problem i want to ask is how to validate the form browser side under this circumference, i implemented one validation plugin but no working in boxy.
__________________
flying dagger
xiaodao is offline   Reply With Quote
Old 12-28-2009, 07:48 PM   PM User | #2
groog
New Coder

 
Join Date: Jun 2007
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
groog is an unknown quantity at this point
Is boxy a jquery plugin?
Setup alerts throughout your script to check what the variables look like. Also can you post your php side?
groog is offline   Reply With Quote
Old 12-28-2009, 08:07 PM   PM User | #3
xiaodao
Regular Coder

 
Join Date: Sep 2004
Posts: 713
Thanks: 6
Thanked 2 Times in 2 Posts
xiaodao is an unknown quantity at this point
yes, it is official plugin

server side
Code:
if($_REQUEST['do']=="ajaxRegister"){
	echo "haha";
}
__________________
flying dagger
xiaodao is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:27 PM.


Advertisement
Log in to turn off these ads.