Click to See Complete Forum and Search --> : Small probs. for data Insert


chaudhari
02-10-2005, 02:25 AM
Hi All,
I have a form (addEmp.asp) that collect EmpData From User, ok
then this form i submitted at validateFrm.asp for validation of form's fields(Means server side validation).
if any field Entry is empty Or Invalid, then this validatefrm.asp redirect the origimnal addEmp.asp form.
Now My Probs is "How can i redisplay field's input back into the addEmp.asp?"

Plz help Me as soon as possible,
i hope U can.
Regards,
Chaudhari:confused:

buntine
02-10-2005, 08:53 AM
One way is to use the QueryString collection. You can collect the data on the validatefrm.asp page and send that data back to the addEmp.asp page.

You will have to edit addEmp.asp slightly so it can display the values.

' This is an example only. You will need to do something like this:
<input type="text" name="empName" value="<%= Request.QueryString("empName") %>" />

In validateemp.asp, if a field is empty, just generate the correct URL to be directed to.

Dim strURL
strURL = "addEmp.asp?empName=" & Request.Form("empName") & "&empAddress=" & Request.Form("empAddress")
Response.Redirect(strURL)

Note, your form names will be different to the ones I used for this example.

Do you understand what I mean?

Regards.

chaudhari
02-12-2005, 01:26 AM
Thanks Buntine,
I Real Understand your suggetation, But Big probs. is that is have a lot's of input fields(Near By 71) in one form,
so plz i can't manage that solution,
if u have another option PLz Help,
Thnax in advance,
Regards,
Chaudhari

buntine
02-12-2005, 01:40 AM
You could output a JavaScript statement that just emulates the "back" button on the browser.

<script language="javascript">
history.go(-1);
</script>

If there is a validation error. Have that script output to the browser, and it should take thme back to the previous page with all their data still intact.

Regards.