Click to See Complete Forum and Search --> : Remember all inputfields...


mf22cs
05-09-2003, 09:15 AM
Hi,

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.

Anyone?

I use Javascript as my lanuage. So please use that, otherwise I have to try to understand VB...

/Marcus

mf22cs
05-09-2003, 09:42 AM
Well, as soon as you ask for help you find the solution your self...

sheila
05-09-2003, 11:09 AM
What was the solution?!

mf22cs
05-09-2003, 01:31 PM
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.

/Marcus

Ribeyed
05-09-2003, 01:38 PM
hi,
very simple to do. All you do is request the form objects in the usually way:


textbox1 = request.form("textbox1")
checkbox1 = request.form("checkbox1")
radio1 = request.form("radio1")


Then in the original form you have the following code. Remember that the form has been posted back to itsself.
For the textbox do this:

<input name="textbox1" type="text" value="<%=textbox1%>">

For the checkbox do this:

<input name="checkbox1" type="checkbox" value="Value1" <%if checkbox1 = "Value1" then response.write "Checked" end if%>>


and the radio:

<input name="radio1" type="radio" value="yes"<%if radio1 = "yes" then response.write "Checked"%>>

mf22cs
05-09-2003, 01:58 PM
I realized that I had misspelled ">=" ;)

/Marcus