aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Is there a standard behavior for save buttons on forms? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Is there a standard behavior for save buttons on forms?" Watch "Is there a standard behavior for save buttons on forms?" New topic
Author

Is there a standard behavior for save buttons on forms?

Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

Is there a web standard that says that when the save button is clicked on a form that the form is submitted and then the form should close?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
HTML standards are defined by the W3C - for example this documentation of FORMS in HTML.


Bill
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

There is no such thing as a "save button"; did you mean "submit"? If so, the standard behavior is to submit the form to its action when the submit button is clicked.

As for "closing the form", I have no idea what you mean by that. The page is replaced by whatever the response to the submit is.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

By "Save" button, I meant the submit button. The button says "Save", and the action is submitting the form data. I was told that the "web standard" is to submit the data and close the form, but I cannot confirm that. I looked atW3C but did not see anything saying that that is the case.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

The button can say anything, so the fact that yours says "Save" is not relevant and didn't tell us anything about its type. Buttons have types defined by HTML, such as "submit", "button", "reset".

Again, you'll need to explain what you mean by "close the form". The form will be submitted to the server action. What happens after that is up to whatever the server code decides to do.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

By "close the form" I mean to exit the form and return to whatever the page was prior to the form be opened. What I'm doing is presenting a list of records. A user can click on a button to open a record from the list to edit it. One of my colleagues said that the "web standard" is that the edit form should be closed and the list displayed when the user clicks the save "submit" button. I'm trying to confirm if that is true or not.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

No, there is no "web standard" for what happens after a form is submitted. The app can do whatever the business logic of the app dictates. If that's returning to a previous page (with updated data, no doubt) so be it. But there's no "standard" beyond what makes sense for the application and good usability.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
What exactly do you mean by "opening" and "closing" a form?

An HTML FORM element is part of a page displayed by the browser, it doesn't have an "open" or "closed" property.

Are you perhaps trying to get at enabling or disabling the submit button?

There is no standard for automatically disabling the submit button after it has been pressed, which is why you can get multiple requests submitted from the same form.

Bill

Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

By "opening" I mean displaying the form.
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
When you click on a submit button or click on any link, A request is made to a server which can server either a static or dynamic content based on the requested resource. The server sends back the response to browser in an HTML format and browser renders the response as it receives from server. There is no opening and closing of HTML form. If the response from the server is same as previously
displayed page, you will see the same page and if response is different , you get to see a new page.

Although you can open a new window by clicking on a link or by submitting on a form (i.e most of the websites have help link which is displayed in seperate window), it is not considered a good practice to do so.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

This simple question is being buried in semantics so let me state the scenario as simply as possible. In a web page I display a list of records. The user clicks on a button that says edit. The server serves up the edit page to the browser. The browser displays the page for editing the record. The user edits the record and clicks on a button that submits the edit record information to the server.

What is the next page that the server sends to the browser?
I have a coworker that says that the "standard" says that the server should display the list.
Is their any design standard or standard for best practices that states that when a user clicks on a button and submits the data to the server that the result from the server has to be the original list or can I just keep the user on the page that he is editing?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can send the user to wherever you want. There is no standard on this.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

So I'll repeat what's already been said by me and others so it's perfectly clear: there is no such such standard. None. Nada!

Your next page can be whatever it wants to be. Anything. It can be the original list if that's what makes the most sense for the business needs of the application. But it could be something else completely if that's what makes sense.

Your coworker can claim anything he likes. It doesn't make it so.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

Thanks y'all!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a standard behavior for save buttons on forms?