Anyone know HTML?

Discussion in 'Web Design and Development' started by PowerFullMac, Feb 28, 2008.

  1. PowerFullMac macrumors 601

    PowerFullMac

    Joined:
    Oct 16, 2006
    #1
    Right, im new to HTML and want to learn, but im helping my friend out with a web app for the iPhone and need to make a text box you can type a number in to then press a button that will dial it. I know to dial a number you use <a href="tel:1-408-555-5555">1-408-555-5555</a> but how to I get it to take input from a text box?

    Thanks in advance.
     
  2. edesignuk Moderator emeritus

    edesignuk

    Joined:
    Mar 25, 2002
    Location:
    London, England
    #2
    This should work...

    HTML form:
    Code:
    <form name="dial" action="javascript:Dial()">
    <input type="text" name="number">
    <input type="Submit" value="Call">
    </form>
    Javascript:
    Code:
    <script>
    function Dial(){
    location.href="tel:"+document.dial.number.value;
    }
    </script>
     
  3. PowerFullMac thread starter macrumors 601

    PowerFullMac

    Joined:
    Oct 16, 2006
  4. PowerFullMac thread starter macrumors 601

    PowerFullMac

    Joined:
    Oct 16, 2006
    #4
    One more thing, any tips on how to change that code to work with Google Maps, Mail etc.
     
  5. edesignuk Moderator emeritus

    edesignuk

    Joined:
    Mar 25, 2002
    Location:
    London, England
    #5
    eh? Make what work with Google Maps, Mail exactly?
     
  6. PowerFullMac thread starter macrumors 601

    PowerFullMac

    Joined:
    Oct 16, 2006
    #6
    That code, so instead of dialing a number you could type a location for Google Maps, for example.

    Dont worry, I just worked it out though!
     
  7. Hankster macrumors 68020

    Hankster

    Joined:
    Jan 30, 2008
    Location:
    Washington DC
    #7
    Don't forget many of the features offered by Google are optional to being added to a site. They have a page with the code for all their features to make embedding their features into your site easy.
     

Share This Page