Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if specific fields filled out then after submit open more fields 2

Status
Not open for further replies.

evr72

MIS
Dec 8, 2009
265
US
Hello,

I am trying to create a form using asp, not sure if I would need a javascript for what I am trying to accomplish or if I could do it with asp.

what I am trying to accomplish is that the user has a form with name, last name, address, phone, email, couple of questions, after the user has filled out everyting when the user clicks on submit, then it opens the same questions filled out, plus a few more

any advice in tackling this one is appreciated
 
Many different solutions and approches here.

I once wrote an intranet survey for employees.
Page1.asp had a FORM with action=page2.asp, Page2.asp e form with Page3.asp, etc

This was not flexible enough. There where a lot of pages (for each topic a different one), and each them a question was chenged/ added i had to find the correct PageXX.asp. So i changed that to a Questions.asp with was retrieving the questions per topic (a servervariable) from a database table....

It might also possible to do it with 1 script file. Eg a questions.asp with a action=questions.asp. Your script start with a check if it is launched a 2nd time, eg
if request.servervariables("REQUEST_METHO") = "POST" then

You then fill the fields by using request.form , and but new questions on screen....


 
this should give you a good starting point

Code:
<%
' by default, the form was not completed and post back to this page
blnFormEntered = false
frmAction = "this_page.asp"
' if the submit button was pressed
if request.form("btnSubmit") = "Submit" then
	' the form was completed, post to a different page
	blnFormEntered = true 
	frmAction = "another_page.asp"
	' collect the values from the form
	strFirstName = request.form("tbxFirstName")
	strLastName = request.form("tbxLastName")
end if
%>

<form action="<%=frmAction%>" method="post">
<input type="text" name="tbxFirstName" value="<%=strFirstName%>" /><br />
<input type="text" name="tbxLastName" value="<%=strLastName%>" /><br />
<% if blnFormEntered then %>
' additional form fields go here
<% end if %>
<input type="submit" name="btSubmit" value="Submit" />


--------

GOOGLE is a great resource to find answers to questions like "how do i..."


--------
 
Thank you both.

thanks to you I was able to get the results I wanted I really appreciate the help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top