Results 1 to 5 of 5

Thread: [RESOLVED] submit a form with <a>?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Resolved [RESOLVED] submit a form with <a>?

    how can i submit with this code?

    i made it 2 images because i tried getting the forms matching on all browsers but well the only solution i found was to make images... so now i need to know how i can submit the form with the login button(a/div/image, i'm confused xD)

    and i got the reset button under control, its just a simple javascript...
    Code:
    <a href=""><div class="buttonimgs id1"><p style="margin-top:3px;">Login</p></div></a>
    <a href=""><div class="buttonimgs id2"><p style="margin-top:3px;">Reset</p></div></a>
    ps: the div class is where the image comes from...

  2. #2
    Lively Member
    Join Date
    Jan 2010
    Location
    Republic of Macedonia
    Posts
    114

    Re: submit a form with <a>?

    Code:
    <a href="javascript:void(0);" onclick="document.form1.submit();"><div class="buttonimgs id1"><p style="margin-top:3px;">Login</p></div></a>

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: submit a form with <a>?

    hehe thanks for replying, i was just about to post that i've figured it out and mark as resolved, but still thank you very much, i did it another way, and i believe your way looks better...

    Code:
    <a href="javascript:document.loginform.submit();"><div class="buttonimgs id1"><p style="margin-top:3px;">Login</p></div></a>

  4. #4
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: [RESOLVED] submit a form with <a>?

    uh, yeah, you shouldn't have block elements (div, p) inside of an inline element (a). just style the anchor tag if you need to instead.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: [RESOLVED] submit a form with <a>?

    i know, this was the easiest way i found, and kinda strange, it shows exactly how i want in all browsers...

Posting Permissions

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



Click Here to Expand Forum to Full Width