Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
1.11/5 (2 votes)
See more:
..In a requirement i have a html input text for asking the user to enter url...what the thing here is user may enter his url with like http://www.domain.com that's fine..but what happens if user just enters domain.com....?here my code need to add http://www for the given text in html input...so i just want to check whether an url in input text contains http://www or not...if no...? my code need's to add this prototype(http://wwww)...any suggestions or advices.....i am very much happy to fallow............:)...:)...:)
Posted
Comments
[no name] 17-Jul-14 7:01am    
Have you actually tried anything before reposting? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
Naveen Kumar Malli 18-Jul-14 11:04am    
ya but i haven't achieved 100% requirement...

1 solution

You already received a suggestion to this question at How Do I Check Whether An Url Consists Of Http://[^]. Please do not repost the same question, edit the original.
 
Share this answer
 
Comments
Naveen Kumar Malli 18-Jul-14 9:01am    
ya..that's not suitable for my requirement ..so i again re improved in a better way and i posted it..?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900