Hi all, I am at a stand still with trying to figure this out.

I have a textarea, i would like to check for links entered by users and replace/remove the anchor attribute from the string.

ie. change <a href='google.com'>website</a> to website its more so to validate ( i have a php side working to validate for links but am trying to get jquery to just remove it and maybe say a warning.

function textarea(){
	var message = $("#text").val();
     // How would you check the text here and remove all links typed in by the user
});

if someone might know where to start with this it would be much appreciated

Thanks,

Recommended Answers

All 2 Replies

Please read this example. It should be exactly what you are looking for. That's from a google search by the way...

Thanks that's exactly what I was looking for. I tried searchin google but I think i was trying to specific of keywords "jquery check for links in textarea" etc.

Sometimes another view can be so helpful.

Thanks again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.