n8w Posted January 14, 2007 Share Posted January 14, 2007 I have a portal where people submit links .. but I want to make sure none of the links end in "/"for exampel .. I want the links submitted to be like http://www.phpfreaks.comnothttp://www.phpfreaks.com/I am trying to check this with javascript .. but can't get it to work[code]var the_headline_link=/$(\/)/ if (document.submitlinks.link_url.value.search(the_headline_link) == -1 ){ message+='Link can not end with / \n'; problem='yes'; }[/code] Quote Link to comment Share on other sites More sharing options...
fenway Posted January 15, 2007 Share Posted January 15, 2007 Well, first, why not just strip the trailing slash? Second, you need to anchor your RE at the end with a '$', not at the beginning. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.