Hi all.
I'm creating an xhtml form on a page for my company's intranet site. One of the entires of the form is a number that represents a key of a customer. Because there are many customers, I've created a popup window (using jquery & thickbox) with another form to allow users to search for the key by customer name. However, the user never sees the key, it's placed directly into the form. Basically, they search for the name, and see a bunch of results (names of companies). When they click a result, then the thickbox window disappears, the name of the company is shown on a label in the form (which isn't part of the form's data, that is to say, it doesn't have a "name" attribute), but the key is stored into a hidden input (which IS part of the form's data).
This works well when a user comes to the page the first time, uses the popup tool to find a customer and the key and name are both placed into their respective areas. However, because the customer name is stored on a label not part of the form, whereas the key is stored on the form, there are times when the user might come back to the page to have the form values still saved.
For example, a user first reaches the page, which means my values are as follows:
Hidden Key Value: 0
Customer Name: --NONE--
Now, when the user uses the popup tool to find a customer, they click one, and now the fields are set as...
Hidden Key Value: 6344
Customer Name: Joe Customer
They finish filling out the rest of the form, and hit submit. Now, for some reason, they decide to click back. Here is what the values are...
Hidden Key Value: 6344
Customer Name: --NONE--
Obviously, the key and customer name do not match up, which could cause incorrect entries.
My question, then, is what causes this? Is this a W3C standard behavior, or just something that a bunch of browsers do? And, more importantly, how can I disable it? I would like to have the fields reset to blanks and "nones".
Also, is there perhaps a better way of doing this? I just did it based on my own free will, not really researching if there was a better "best practice".
Thanks in advance!
I'm creating an xhtml form on a page for my company's intranet site. One of the entires of the form is a number that represents a key of a customer. Because there are many customers, I've created a popup window (using jquery & thickbox) with another form to allow users to search for the key by customer name. However, the user never sees the key, it's placed directly into the form. Basically, they search for the name, and see a bunch of results (names of companies). When they click a result, then the thickbox window disappears, the name of the company is shown on a label in the form (which isn't part of the form's data, that is to say, it doesn't have a "name" attribute), but the key is stored into a hidden input (which IS part of the form's data).
This works well when a user comes to the page the first time, uses the popup tool to find a customer and the key and name are both placed into their respective areas. However, because the customer name is stored on a label not part of the form, whereas the key is stored on the form, there are times when the user might come back to the page to have the form values still saved.
For example, a user first reaches the page, which means my values are as follows:
Hidden Key Value: 0
Customer Name: --NONE--
Now, when the user uses the popup tool to find a customer, they click one, and now the fields are set as...
Hidden Key Value: 6344
Customer Name: Joe Customer
They finish filling out the rest of the form, and hit submit. Now, for some reason, they decide to click back. Here is what the values are...
Hidden Key Value: 6344
Customer Name: --NONE--
Obviously, the key and customer name do not match up, which could cause incorrect entries.
My question, then, is what causes this? Is this a W3C standard behavior, or just something that a bunch of browsers do? And, more importantly, how can I disable it? I would like to have the fields reset to blanks and "nones".
Also, is there perhaps a better way of doing this? I just did it based on my own free will, not really researching if there was a better "best practice".
Thanks in advance!