Results 1 to 6 of 6

Thread: Submitting and resetting forms with links and images

  1. #1
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Red face Submitting and resetting forms with links and images

    Hi,, I am trying to submit/reset forms using links and images from outside the <form> tag

    I was using this:
    <a href="#" onclick="document.getElementById('formname').submit();"> Test link for submitting form </a>
    and
    <a href="#" onclick="document.getElementById('formname').reset();"> Test link for reseting form </a>
    but they don't seem to work. Help please.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Is there a reason why it has to be outside the form tagS?
    With the the form it can be done quit easily with input types.

  3. The Following User Says Thank You to bluewalrus For This Useful Post:

    codetc (02-12-2009)

  4. #3
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Not particularly - just wanting a more uniform interface - for the form to fit in with the rest of the site.

  5. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Would this work?
    <input type="submit" src="" />
    <input type="reset" src="" />

  6. The Following User Says Thank You to bluewalrus For This Useful Post:

    codetc (02-12-2009)

  7. #5
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    That would still be within the <form> .. </form>?

    WIth src being the location of the image/link? Would that work with no <img> tag?

  8. #6
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Yea. These are all (or atleast a lot) possible input attributes and what they do. http://htmlhelp.com/reference/html40/forms/input.html

Bookmarks

Posting Permissions

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