www.webdeveloper.com
Results 1 to 4 of 4

Thread: Small probs. for data Insert

  1. #1
    Join Date
    Jan 2005
    Location
    Mumbai, India
    Posts
    30

    Small probs. for data Insert

    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

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    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.
    Code:
    ' 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.
    Code:
    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.

  3. #3
    Join Date
    Jan 2005
    Location
    Mumbai, India
    Posts
    30

    Plz tell me

    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

  4. #4
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    You could output a JavaScript statement that just emulates the "back" button on the browser.
    Code:
    <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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles