SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Old Fogey mancroft's Avatar
    Join Date
    Oct 2002
    Location
    lost
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript form: text link instead of button

    Javascript form: text link instead of button

    instead of having a button as a big grey thing, is it possible to have a <a href> style text link?
    :

    :

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you mean something like this:
    <a href="somepage.html">Click Here</a>

    If not give us some more details on what you are trying to do.

  3. #3
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's possible to have an image. Turn off anti-aliasing in Photoshop/your image editor of choice et voila! One image that looks like a normal hyperlink!


  4. #4
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Code:
    <a href='#' onClick="this.form.submit();">Submit</a>

  5. #5
    Old Fogey mancroft's Avatar
    Join Date
    Oct 2002
    Location
    lost
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.
    :

    :

  6. #6
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wrong. this refers to the Link object, not a form element.

    <a href='#' onclick="document.forms[n].submit()">Submit form</a>

    ...where n is the number of the particular form you want submitted (usually 0 - JS counts from zero).
    ::: certified wild guess :::

  7. #7
    SitePoint Enthusiast
    Join Date
    Jun 2003
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    .
    Last edited by pietro; Jun 16, 2007 at 04:57.

  8. #8
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by DJ P@CkMaN
    Code:
    <a href='#' onClick="this.form.submit();">Submit</a>
    This would rely on a user having Javascript enabled. Not very good for usability. I suggest styling the submit button with CSS instead if you hate the grey (and remember, that's only on Windows. Mac and Linux users, or Windows users with different desktop themes, will see something different).


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
  •