View Single Post
Old 07-26-2009, 05:21 PM   PM User | #5
510carlos
New Coder

 
Join Date: Jul 2009
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
510carlos is an unknown quantity at this point
Quote:
Originally Posted by venegal View Post
What exactly do you want? You already got the value there in your beforeSend. You want to add your own value? Just do it then.

If you want me to help, you have to be a bit more specific about what exactly is causing you trouble.

On a side note: The parameter msg has to hold the selector string for your container DOM element. Why on earth would you call that "msg"?

Also, do you have any good reason to use synchronous AJAX?

Oh, interesting. Just when I wrote "synchronous AJAX" I threw up a little.

Again.
I think I answered that question.
I really don't know because i am new to the jquery scene, I was just trying to get with trial an error.
I also don't know why i used synchronous, I guess i'll switch it.

It gave me an error in firebug. "Field is underdefiened"

Code:
	$.ajax({
  type: "POST",
   url: "file.php",
   dataType: "html",
   beforeSend: function(msg){ 
		var field = $(msg).find('[name*=user]').get(0);
		field.value += field.value ? "your value if username exists" : "your value if username doesn't exist";
		alert(field);
	},
 });

Last edited by 510carlos; 07-26-2009 at 05:33 PM..
510carlos is offline   Reply With Quote