Quote:
Originally Posted by venegal
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);
},
});