Jump to content

Need help with a 'Copy & Replace' textbox please :)


ScottishDuck13
 Share

Recommended Posts

Hi guys,

In my work we have to send texts to people through emails. The format needs to be +447123456789@sms.com (as an example).

I have an HTML page with some helpful notes, links etc I keep open for quickness. What I want is to have a textbox on the page that I can type a standard mobile number into as '07123456789' and a copy button under it that will copy it as +447123456789@sms.com.

So it needs to replace the '0' with '+44' and add the '@sms.com' on the end.

I have seen it done before but can't figure out how. I know basic coding but I am better at tearing apart and rearranging to make it how I want than writing from scratch. Might be something really simple but I am just missing it!

Any help would be much appreciated! smile.gif

Thanks

Link to comment
Share on other sites

Each language has its purpose. HTML give the page a structure, CSS give it appearance and Javascript is for behavior. HTML alone can't do anything to process form elements.

 

With Javascript it's very simple to do what you're asking.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...