WhiteSpace problem
Hi All,
When loading a form, some of my field are pre-populated from the querystring. Where these values may have spaces, on the querystring they appear as %20 and so as a result, I would only get the field's being half populated (e.g. if a Postcode of CM6 1WP was entered the querystring would be CM6%201WP. The forms textbox would only show CM6.
To aleviate this problem, I introduced:
<input maxlength=12 size=8 name=""Postcode"" value=" & replace(strPostcode," "," ") & ">
which on an initial load of the form works.
However, the user then goes through the remainder of the form entering details. Then the user presses the save button. At this point some basic validation in the head section is performed such as formating etc. As part of this the postcode is checked for correct format. First time through it's all ok. The form then post's to itself and some serverside checking is done. If servere side checking fails, then the textboxes are re-populated using request.form method to allow the user to change the offending data. The user then presses the save button again and again the postcode is checked from the head section. But this time fails format validation even though the postcode hasn't been touched by the user. If the postcode had been overtyped with the same value, then it would have passed. I cannot figure out why it fails on a re-post of the page. I have tried hardcoding the value so that it's not taken from the form object, but it makes no difference.
Help please :(
|