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 11-25-2011, 05:58 AM   PM User | #1
CoolD
New to the CF scene

 
Join Date: Nov 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
CoolD is an unknown quantity at this point
Problem Ajax, cant read value. help!!!!

when pressing submit button, didnt show anythg in span status. it shud b change 'zzz' to 'check availability', after that either show 'availability' or other msg from my php file, but it juz show till 'check availability' and bck to 'zzzz', so is there any error?? pls help me!!!!

Code:
$(document).ready(function(){
		$("#submit").click(function()
			{
				
				var noIC = $("#noIC").val();
				var password = $("#password").val();
				var msgbox = $("#status");
				
				msgbox.html('Checking availability');
				
				
				$.ajax({
					   type: "POST",
					   url: "loginphp.php",
					   data: "noIC=" + noIC,
					   success: function(msg){
						   alert(msg);
						  
						   $("#status").ajaxComplete(function(event, request){
															  
						   if(msg == "OK"){
							   alert('Handler for .click() called.');
							   msgbox.html('availability') 
							   			}
							   //$(document.location = "order1.html");
						  else{
							   alert('Handler for .click() called.');
							   msgbox.html(msg);}
						   
										 					 });
					   }
						  
					  });
									});
						   });
					   
</script>				
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <p>
    <label>IC    
      <input type="text" name="noIC" id="noIC" />
    </label>
  </p>
  <p>
    <label>password
      <input type="text" name="password" id="password" />
      <span id="status">zzzz</span>
    </label>
  </p>
  
  <p>
    <label>
      <input type="submit" name="submit" id="submit" value="Submit" />
    </label>
  </p>
</form>

Last edited by Kor; 11-25-2011 at 01:23 PM.. Reason: moved to the proper Forum and set the proper prefix
CoolD is offline   Reply With Quote
Old 11-25-2011, 10:36 AM   PM User | #2
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Is this JQuery? Prototype? MooTools? Scriptaculous? Google API? Yahoo API, other?

If you are using a framework, please specify which framework is that. We are not suppose to guess.
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 11-25-2011, 01:18 PM   PM User | #3
CoolD
New to the CF scene

 
Join Date: Nov 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
CoolD is an unknown quantity at this point
sorry~ dis is ajax + jquery~
CoolD 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 07:37 AM.


Advertisement
Log in to turn off these ads.