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 4 of 4

Thread: text to submit

  1. #1
    New Coder
    Join Date
    Aug 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    text to submit

    Hello all

    I wanna submit a form by a text or something like link: I use this :

    Code:
    <a href='#'  onClick="forms['a3'].submit()">Home</a>
    1-is this a javascript function?
    2-when I use it, the page goes up cuz of href='#', can you give me a method that, the txt act as a link and submit on click ?
    (the page doesnt jump and also onmouse over the mouse changes to a link symbol)

    Thanks alot

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    hi,

    i would set it out like so...

    Code:
    <div onClick="document.form1.submit();" style="cursor:pointer;">submit</div>
    hope this helps.

  • #3
    New Coder
    Join Date
    Aug 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mic2100 View Post
    hi,

    i would set it out like so...

    Code:
    <div onClick="document.form1.submit();" style="cursor:pointer;">submit</div>
    hope this helps.
    Yes, nice, but its javascript, can you suggest any other method to submit like this without js ?

    Thanks

  • #4
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    yeah u can use a submit button or the code as above, to submit a form without a button requires some kind of script i think.


  •  

    Posting Permissions

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