By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,310 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

CSS 3 in Firefox / Google Chrome

P: 426
I'm using a url type as an input box so that the keypad will be optimised for people to enter a web address on mobile devices.
It doesn't allow them to enter it without http at the front but I can't guarantee they will realise the need to put http in front of it so I put that as the value in the box but that means on Google Chrome in rejects the box and an unfinished website address. Since entering in a website is not a required field I don't want it to do this. Is there any way round this?
Expand|Select|Wrap|Line Numbers
  1. <input type="url" name="website" value="http://"/>
Apr 24 '12 #1
Share this Question
Share on Google+
4 Replies

ariful alam
P: 185
you can add the placeholder attribute in the input tag. it will show a message to user to input with http://
here is the code:

Expand|Select|Wrap|Line Numbers
  1. <input type="url" name="website" placeholder=""/>
Jul 9 '12 #2

Murat Bastas
P: 25
Placeholder does not work in internet explorer v9-oldest...

I suggested
Expand|Select|Wrap|Line Numbers
  1. <input type="text" id="tbox" onfocus="clearVal();" onblur="fillVal('example');" value="example" />
  2. <script>
  3. function fillVal(val){
  4. document.getElementById('tbox').value=val;
  5. }
  6. function clearVal(){
  7. document.getElementById('tbox').value='';
  8. }
  9. </script>
Jul 30 '12 #3

ariful alam
P: 185
his asking was related to Firefox/Google Chrome. so, answer was related that.
Jul 30 '12 #4

Murat Bastas
P: 25
But my suggestion is works all browsers.
Jul 30 '12 #5

Post your reply

Sign in to post your reply or Sign up for a free account.