Hi,
What i'm trying to do is search a textarea while the user is typing for a url beginning with http:// then if found, fire a function, and stop searching for an url.
I know this can be done with jQuery but I'm having quite a few issues with :contains, indexOf, regex, etc.
heres a bit of code to explain what I'm trying to do!
$(document).ready(function() {
var body = $('#example').attr('value');
body = encodeURIComponent(body);
var urlregex = new RegExp("^(http:\/\/www.|http:\/\/www.|www.){1}([0-9A-Za-z]+\.)");
if(urlregex.test(body)) {
$("#new_url").html('../images/loading.gif" border="0">');
$.ajax({
type: "GET",
url: "get_url.php",
data: "entry="+body,
cache: false,
success: function(html) {
$("#new_url").html(html);
}
});
return false;
}
return(false);
}
});
Thanks for all your help...