action in forms

Discussion in 'HTML' started by dorayme, Dec 31, 2004.

  1. dorayme

    dorayme Guest

    Now and then I have used

    <div align="center">
    <FORM>
    <INPUT TYPE="button" VALUE=" back " onClick="history.go(-1)">
    </FORM>
    </div>

    to allow people to go back to the page they were at before.

    But W3C says "required attribute "ACTION" not specified"

    When I put <FORM action="">, it solves *this* problem but I can't believe it
    is the right way to go... I am asking what is the *closest* correct code to
    mine to do this if this if mine is not really kosher...

    dorayme

    [To email me directly so I get it, please use "12345" without the quotes
    somewhere in the subject line]
     
    dorayme, Dec 31, 2004
    #1
    1. Advertising

  2. dorayme

    Oli Filth Guest

    dorayme wrote:
    > Now and then I have used
    >
    > <div align="center">
    > <FORM>
    > <INPUT TYPE="button" VALUE=" back " onClick="history.go(-1)">
    > </FORM>
    > </div>
    >
    > to allow people to go back to the page they were at before.
    >
    > But W3C says "required attribute "ACTION" not specified"
    >
    > When I put <FORM action="">, it solves *this* problem but I can't believe it
    > is the right way to go... I am asking what is the *closest* correct code to
    > mine to do this if this if mine is not really kosher...
    >
    > dorayme
    >
    > [To email me directly so I get it, please use "12345" without the quotes
    > somewhere in the subject line]
    >


    You're using a form as a means of navigation, which isn't what it's
    designed for. What's more, users have a perfectly good back button on
    their browser already; what's the point in putting one on your page?

    This also relies on the user having Javascript enabled; if they don't
    then your button will do nothing.

    If you do want to get your code to validate, however, get rid of the
    <FORM></FORM> tags, and make sure the button is inside a DIV.

    Oli
     
    Oli Filth, Dec 31, 2004
    #2
    1. Advertising

  3. dorayme

    Oli Filth Guest

    dorayme wrote:
    > Now and then I have used
    >
    > <div align="center">
    > <FORM>
    > <INPUT TYPE="button" VALUE=" back " onClick="history.go(-1)">
    > </FORM>
    > </div>
    >
    > to allow people to go back to the page they were at before.
    >
    > But W3C says "required attribute "ACTION" not specified"
    >
    > When I put <FORM action="">, it solves *this* problem but I can't believe it
    > is the right way to go... I am asking what is the *closest* correct code to
    > mine to do this if this if mine is not really kosher...
    >
    > dorayme
    >
    > [To email me directly so I get it, please use "12345" without the quotes
    > somewhere in the subject line]
    >


    One more thing. The align attribute for DIVs, etc. is now deprecated.
    Use CSS instead.

    Oli
     
    Oli Filth, Dec 31, 2004
    #3
  4. dorayme

    dorayme Guest

    > From: Oli Filth <>
    > Organization: Virgin Net Usenet Service
    > Newsgroups: alt.html
    > Date: Fri, 31 Dec 2004 02:01:50 GMT
    > Subject: Re: action in forms
    >
    > dorayme wrote:
    >> Now and then I have used
    >>
    >> <div align="center">
    >> <FORM>
    >> <INPUT TYPE="button" VALUE=" back " onClick="history.go(-1)">
    >> </FORM>
    >> </div>
    >>
    >> to allow people to go back to the page they were at before.
    >>
    >> But W3C says "required attribute "ACTION" not specified"
    >>
    >> When I put <FORM action="">, it solves *this* problem but I can't believe it
    >> is the right way to go... I am asking what is the *closest* correct code to
    >> mine to do this if this if mine is not really kosher...
    >>
    >> dorayme
    >>
    >> [To email me directly so I get it, please use "12345" without the quotes
    >> somewhere in the subject line]
    >>

    >
    > You're using a form as a means of navigation, which isn't what it's
    > designed for. What's more, users have a perfectly good back button on
    > their browser already; what's the point in putting one on your page?
    >
    > This also relies on the user having Javascript enabled; if they don't
    > then your button will do nothing.
    >
    > If you do want to get your code to validate, however, get rid of the
    > <FORM></FORM> tags, and make sure the button is inside a DIV.
    >
    > Oli



    and in later post:

    >One more thing. The align attribute for DIVs, etc. is now deprecated.
    >Use CSS instead.



    Thank you. You remind me to do things I know better and tell me something I
    did not realise, about the form tag. I must have grabbed this bit of code
    somewhere and stuck it in, it has been useful in that one does not need to
    move the mouse to the browser back-button (or know and use key commands). In
    context, it is handy but it is not very important being there or not. I
    might leave it out? I put it in for emphasis so that folk are less tempted
    to go off on some other train. And for reason stated below. But folk are
    more savvy these days and I should trust them.

    There is a little issue with the browser back-button that puts me off it
    somewhat on dial-up, I get so many pages on so many sites reloading slowly
    instead of instantly appearing from the cache on the HD on so many sites
    these days, (eg. on eBay and Internet Movie Database). It does not happen on
    sites I have made (that are fetched online from a remote server) but my
    point is there may be other folk who are wary on dial-up of pressing the
    browser back-button and having to wait again...

    dorayme

    [To email me directly so I get it, please use "12345" without the quotes,
    somewhere in the subject line]
     
    dorayme, Jan 1, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Bloggs
    Replies:
    1
    Views:
    951
    Sudsy
    Aug 3, 2003
  2. rjweytens
    Replies:
    6
    Views:
    16,302
    rjweytens
    Jun 25, 2004
  3. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,926
    runescience
    Feb 7, 2006
  4. vyshu
    Replies:
    1
    Views:
    2,666
    Richard Senior
    Apr 27, 2007
  5. John
    Replies:
    0
    Views:
    985
Loading...

Share This Page