Remember all inputfields...
I have a problem.
In an assignment I have to make a form in ASP, when you click on submit the form is sent to the server for validation.
If all the inputfields are filled (correct) a ack.page will show, else the form will be displayed again... BUT now all the fields that where filled shall remain filled.
I have tried everything (but the correct way) to do this, well with the text-fields there are no problem. But with the checkbox, the selectbox (there I have a solution, but not as nice as I would like) and the selectbox with multiple.
Well, as soon as you ask for help you find the solution your self...
Well, it only solved the checkbox... and the solution is to on the condition of "Request("checkboxName").Count > 0" been true to add "checked" to the HTML.
But that seems to be more complex this the singel- and multichoice-selectbox, that problem remains.
very simple to do. All you do is request the form objects in the usually way:
Then in the original form you have the following code. Remember that the form has been posted back to itsself.
textbox1 = request.form("textbox1")
checkbox1 = request.form("checkbox1")
radio1 = request.form("radio1")
For the textbox do this:
For the checkbox do this:
<input name="textbox1" type="text" value="<%=textbox1%>">
and the radio:
<input name="checkbox1" type="checkbox" value="Value1" <%if checkbox1 = "Value1" then response.write "Checked" end if%>>
<input name="radio1" type="radio" value="yes"<%if radio1 = "yes" then response.write "Checked"%>>
Solved, but thanks anyway...
I realized that I had misspelled ">="
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)