Click to See Complete Forum and Search --> : javascript code


tito
01-12-2008, 11:34 AM
While I can code php I don't know anything about javascript and I am embarassed by this.

Can someone please convert this simple javascript for me?


$(document).ready(function() {
var options = {
target: '#magerror',
success: showResponse
};
$('#magOne').submit(function() {
$(this).ajaxSubmit(options);
if(responseText.length > 400)
{
return true;
} else {return false; }
});
});
function showResponse(responseText, statusText){
}

trevorsg
01-12-2008, 10:07 PM
Not sure exactly what you are asking. Are you trying to convert JS to PHP? responseText.length I believe would be strlen(responseText) in PHP.

zabmilenko
01-12-2008, 10:08 PM
I must ask, what are we converting it to?

tito
01-12-2008, 10:14 PM
My problem is this: I am using jquery to display an error text in: target: '#magerror'
That works fine. But if there are no errors, the page loads in the target. So I am trying to get rid of the target.

Right now I am at

response: 'req.responseText.split("<!--error-->")'
if (response[0] == '') {
,
target: '#magerror'
}


but still no luck. I have been stuck for 2 days now, trying to get rid of the target based on the response