Results 1 to 3 of 3

Thread: Possible to make text act as submit?

  1. #1
    Join Date
    Oct 2005
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Possible to make text act as submit?

    I was wondering if it is possible to make a specified area of text act as a submit field so it can be formatted and spaced more with more flexibility than a regular Submit button.

    I figure it may take some javascript (just a small amount), but since I dont really know javascript aside from what I've caught on here on DD, easiest thing to do was ask for forum help.

    My guess is use something like
    Code:
    <span onclick="">
    with the onclick being whatever the JS equivalent to
    Code:
    <input type="submit">
    is...

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes. The method you want is form.submit(), where form is a form element.
    Remember to be careful to provide an alternative for non-JS browsers.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by sleipner
    I was wondering if it is possible to make a specified area of text act as a submit field [...]
    You could, but it would be better to make a submit button look like text using CSS. However, users do tend to recognise buttons better when they look like buttons.

    Mike

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
  •