Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    adding a image inplace of a sumit button

    I was wondering how to ad an image i have instead of the default submit button in this code. short amount of code dont worry. Any help would be great thanks!

    <form>
    <p>
    <input type="text" name="text2">
    </p>
    <p>
    <input type="password" name="text1">
    <input type="button" value="Check In" name="Submit"
    onclick=javascript:validate(text2.value,"free",text1.value,"javascript") >
    </p>

    </form>
    <script language = "javascript">

    function validate(text1,text2,text3,text4)
    {
    if (text1==text2 && text3==text4)
    load('success.htm');
    else
    {
    load('failure.htm');
    }
    }
    function load(url)
    {
    location.href=url;
    }
    </script>

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    jim...
    just a try® this kinda coding...
    <INPUT TYPE="image" value="subscribe" SRC="whatever.jpg">

    sooo yourrr....
    <input type="button" value="Check In" name="Submit"
    onclick=java script:validate(text2.value,"free",text1.value,"javascript") >


    twould just a become®...

    <INPUT TYPE="image" SRC="whatever.jpg" value="Check In" name="Submit"
    onclick=java script:validate(text2.value,"free",text1.value,"javascript") >

    just a goodluck® n' welcome to the forum...:O)))

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try
    <button><img....></button>

    oh and your validation should actually be:
    <form onsubmit="return validateForm()" ....
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #4
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try using <a href="#"><img border="0" src="put the submit image" width="?" height="?" onClick="(form name).submit();"></a>

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what justame said
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #6
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, mine's shorter

  • #7
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <a href="#"><img border="0" src="put the submit image" width="?" height="?" onClick="(form name).submit();"></a>
    This brings to mind a recent discussion I had
    regarding using an image as an anchor.

    Is the above correct HTML?
    Or, is ISMAP required when using an image in this context?

    .....Willy

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by benleegt
    No, mine's shorter
    Yes, but yours is wrong - the <a> serves no purpose, and for those who don't have javascript the form won't be submitted at all.

    What justame posted is the semantic HTML method for using an image as a <form> submit button.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #9
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Willy Duitt
    This brings to mind a recent discussion I had
    regarding using an image as an anchor.

    Is the above correct HTML?
    Or, is ISMAP required when using an image in this context?

    .....Willy
    Oooh;

    Let me rephrase my question.
    Is this correct usage?

    <a href="http://google.com"><img src="image.gif" width="?" height="?" alt="Google Link"></a>

    Or, is ISMAP required to be semanticaly correct?

    .....Willy

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry .. I was only talking to benleegt in my other response.

    Yes, that's fine. In fact ISMAP is very old - used only for server-side image maps; for client-side image maps you use USEMAP to refer to a <map>. But what you have there is just a single image link - no need for a map unless you want the image to have more than one linked hotspot.
    Last edited by brothercake; 01-01-2004 at 06:49 AM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •