Link to home
Start Free TrialLog in
Avatar of RickyGtz
RickyGtz

asked on

At least one recipient is required, but none were found. CDO.Message.1 error '8004020c'

i am getting error when trying to send an email to txtemailid,,, I know it means the field is blank but i cant understand why is that if apparenty everyting is passing correct,,, loop problem meabe?
If (Request.Form("Submit")<>"") Then
	
					
		'session("r_tourname")
 		session("r_mcount") = Request.Form("memcounter")
		session("r_tourname") = Request.Form("tourname")
		session("r_txtcourseid") = Request.Form("txtcourseid")
		'session("r_txttourid")= TID
		
			
		'do we need an user name also here ?
		'session("r_txtuname")=request.form("txtuname")
		For p=1 to session("s_memcounter")
		
		
					session("r_txtfname"&p) = Request.Form("txtfname"&p)
					session("r_txtlname"&p) = Request.Form("txtlname"&p)
					session("r_txtemailid"&p) = Request.Form("txtemailid"&p)
					
					response.write "tname :" & session("r_txtfname"&p)
									
					' Retrieve from session variable ???
					teamname=session("s_teamname")	
					tourname=session("s_tourname")
					TIID=session("s_TIID") 
					TID= session("s_TID")
											
					txtfname=request.form("txtfname"&p)
					txtlname=request.form("txtlname"&p)
					txtaddr1=request.form("txtaddr1"&p)
					txtaddr2=request.form("txtaddr2"&p)
					txtcity=request.form("txtcity"&p)
					txtstate=request.form("txtstate"&p)
					txtcourseid=request.form("txtcourseid"&p)
					txtpcode=request.form("txtpcode"&p)
					txtcontactno=request.form("txtcontactno"&p)
					txtemailid=request.form("txtemailid"&p)
					txtshirtsize=request.form("txtshirtsize"&p)
					txthandicap=request.form("txthandicap"&p)
					txthomecourse=request.form("txthomecourse"&p)
					txtball=request.form("txtball"&p)
					txtclub=request.form("txtclub"&p)
							
					regdate=date()
					regtime=time()
					
					response.write "tname :" &txtemailid
  
  'conSQL.execute(sql)
conSQL.execute("Insert into Players(teamname,firstname,lastname,addy1,addy2,city,state,Zip,phone,email,regdate,regtime,TourID,Shirtsize,Handicap,courseID,TIID,golfball,golfclub) values('"&teamname&"','"&txtfname&"','"&txtlname&"','"&txtaddr1&"','"&txtaddr2&"','"&txtcity&"','"&txtstate&"','"&txtpcode&"','"&txtcontactno&"','"&txtemailid&"','"&regdate&"','"&regtime&"','"&TID&"','"&txtshirtsize&"','"&txthandicap&"','"&txthomecourse&"','"&TIID&"','"&txtball&"','"&txtclub&"')")
					
					If Err.Number <> 0 Then
		Response.Write "Error: " & Err.Description
			    response.end
			Response.Write "Unable to Store your Information "
		response.end
 	
		end if
 
					Set rsNewListMember=Server.CreateObject("ADODB.Recordset")
 
					strSQL = "SELECT tblMailingList.* FROM tblMailingList;"
					rsNewListMember.Open strSQL, con3SQL
 
					Randomize Timer
						dim strEmailAdress
						strEmailAdress=""
			        strUserCode = Left(strEmailAddress,2) & (9876989856 * CInt((RND * 32000) + 100))
 
					Do While NOT rsNewListMember.EOF
 
				        If strUserCode = rsNewListMember("ID_Code") Then
 
					        Randomize Timer
 
					        strUserCode = Left(strEmailAddress,2) & (9876989856 * CInt((RND * 32000) + 100))
 
				        rsNewListMember.MoveFirst
				        End If
 
          
                        If strEmailAddress = txtemailid Then
                              blnError = True
                              Exit Do
                        End If
 
				        rsNewListMember.MoveNext
                    Loop
 
			        If strEmailAddress = txtemailid Then
				        blnError = True
		  'Exit Do
			        End If
 
                    Set MyCDO =CreateObject("CDO.Message")
					MyCDO.To = txtemailid
	                'MyCDO.Bcc=txtemaild
	                'MyCDO.Cc=txtemailid
 
	                MyCDO.From = "info@playerscores.com"
	                MyCDO.Subject = "Tournament signup confirmation from playerscores.com "
 
			        MyCDO.HTMLBody = " <br><br>Thanks for registering your team<b> "& request.form("txtteamname")&"</b> online with the <b>"& request.form("tourname") &"</b><br> If you have any questions please do not hesitate to email us at info@playerscores.com <br><br>Thanks<br>PlayerScores.com Staff"
 
 
                    MyCDO.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
                    'Name or IP of remote SMTP server
                    MyCDO.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
                    ="192.168.5.235"
                    'Server port
                    MyCDO.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
                    =25
                    MyCDO.Configuration.Fields.Update
 
 
                    MyCDO.Send
 
 
                    If Err.Number <> 0 Then
		                            Response.Write "Error: " & Err.Description
	                                response.end
	                end if		        'Exit Do

Open in new window

Avatar of hielo
hielo
Flag of Wallis and Futuna image

I see:
session("r_mcount") = Request.Form("memcounter")

and also:
            For p=1 to session("s_memcounter")

perhaps you meant:
            For p=1 to session("r_mcount")

OR:
            For p=1 to Request.Form("memcouter")
Avatar of RickyGtz
RickyGtz

ASKER

tried that but still is only sending to one email, can you look more closely to the code>?
what value are you getting for
Request.Form("memcouter")

do you have a url?
none.
response.write "tname :" & Request.Form("memcouter")


TID= session("s_TID")

If (Request.Form("Submit")<>"") Then
	
					
		'session("r_tourname")
 		session("r_mcount") = Request.Form("memcounter")
		session("r_tourname") = Request.Form("tourname")
		session("r_txtcourseid") = Request.Form("txtcourseid")
		'session("r_txttourid")= TID
		mcoun2 = session("s_memcounter") 
		
			
		'do we need an user name also here ?
		'session("r_txtuname")=request.form("txtuname")
		'For  p=1 to 2
		 For p=1 to Request.Form("memcounter")
		
					session("r_txtfname"&p) = Request.Form("txtfname"&p)
					session("r_txtlname"&p) = Request.Form("txtlname"&p)
					session("r_txtemailid"&p) = Request.Form("txtemailid"&p)
					
					response.write "tname :" & session("r_txtfname"&p)
									
					' Retrieve from session variable ???
					teamname=session("s_teamname")	
					tourname=session("s_tourname")
					TIID=session("s_TIID") 
					TID= session("s_TID")
											
					txtfname=request.form("txtfname"&p)
					txtlname=request.form("txtlname"&p)
					txtaddr1=request.form("txtaddr1"&p)
					txtaddr2=request.form("txtaddr2"&p)
					txtcity=request.form("txtcity"&p)
					txtstate=request.form("txtstate"&p)
					txtcourseid=request.form("txtcourseid"&p)
					txtpcode=request.form("txtpcode"&p)
					txtcontactno=request.form("txtcontactno"&p)
					txtemailid=request.form("txtemailid"&p)
					txtshirtsize=request.form("txtshirtsize"&p)
					txthandicap=request.form("txthandicap"&p)
					txthomecourse=request.form("txthomecourse"&p)
					txtball=request.form("txtball"&p)
					txtclub=request.form("txtclub"&p)
							
					regdate=date()
					regtime=time()
					
					response.write "tname :" &txtemailid
  
  'conSQL.execute(sql)
conSQL.execute("Insert into Players(teamname,firstname,lastname,addy1,addy2,city,state,Zip,phone,email,regdate,regtime,TourID,Shirtsize,Handicap,courseID,TIID,golfball,golfclub) values('"&teamname&"','"&txtfname&"','"&txtlname&"','"&txtaddr1&"','"&txtaddr2&"','"&txtcity&"','"&txtstate&"','"&txtpcode&"','"&txtcontactno&"','"&txtemailid&"','"&regdate&"','"&regtime&"','"&TID&"','"&txtshirtsize&"','"&txthandicap&"','"&txthomecourse&"','"&TIID&"','"&txtball&"','"&txtclub&"')")

Open in new window

>>none.
>>response.write "tname :" & Request.Form("memcouter")
counter is misspelled. It is missing the "n"
still nothing, i think i should use session variables instead?

>>i think i should use session variables instead?
OK, then from what you posted initially try:
...
For p=1 to session("s_memcounter")
 Response.Write( Session("s_memcounter") )
...

It's hard for me to determine what you should try since  I don't know where these values are coming from. Do you have a url?
looping is goign ' fine ' with
mcount2= session("s_memcounter")
                  
             For p=1 to mcount2
but now i get empty values inserted on the database,,,
For p=1 to mcount2
		 
		 	        session("r_txtfname"&p) = Request.Form("txtfname"&p)
					session("r_txtlname"&p) = Request.Form("txtlname"&p)
					session("r_txtemailid"&p) = Request.Form("txtemailid"&p)
		
														
					' Retrieve from session variable ???
					teamname=session("s_teamname")	
					tourname=session("s_tourname")
					TIID=session("s_TIID") 
					TID= session("s_TID")	' this works
					
					
					' this not	
					txtfname=request.form("txtfname"&p)
					txtlname=request.form("txtlname"&p)
					txtaddr1=request.form("txtaddr1"&p)
					txtaddr2=request.form("txtaddr2"&p)
					txtcity=request.form("txtcity"&p)
					txtstate=request.form("txtstate"&p)
					txtcourseid=request.form("txtcourseid"&p)
					txtpcode=request.form("txtpcode"&p)
					txtcontactno=request.form("txtcontactno"&p)
					txtemailid=request.form("txtemailid"&p)
					txtshirtsize=request.form("txtshirtsize"&p)
					txthandicap=request.form("txthandicap"&p)
					txthomecourse=request.form("txthomecourse"&p)
					txtball=request.form("txtball"&p)
					txtclub=request.form("txtclub"&p)
										
								
		'session("r_tourname")
 		session("r_mcount") = Request.Form("memcounter")
		session("r_tourname") = Request.Form("tourname")
		session("r_txtcourseid") = Request.Form("txtcourseid")
		'session("r_txttourid")= TID
		'mcoun2 = session("s_memcounter") 
							
					regdate=date()
					regtime=time()
				  
  'conSQL.execute(sql)
conSQL.execute("Insert into Players(teamname,firstname,lastname,addy1,addy2,city,state,Zip,phone,email,regdate,regtime,TourID,Shirtsize,Handicap,courseID,TIID,golfball,golfclub) values('"&teamname&"','"&txtfname&"','"&txtlname&"','"&txtaddr1&"','"&txtaddr2&"','"&txtcity&"','"&txtstate&"','"&txtpcode&"','"&txtcontactno&"','"&txtemailid&"','"&regdate&"','"&regtime&"','"&TID&"','"&txtshirtsize&"','"&txthandicap&"','"&txthomecourse&"','"&TIID&"','"&txtball&"','"&txtclub&"')")
					
					If Err.Number <> 0 Then
		Response.Write "Error: " & Err.Description
			    response.end
			Response.Write "Unable to Store your Information "
		response.end

Open in new window

are you sure that is the correct page? I see you posted:
If (Request.Form("Submit")<>"") Then

but the name of the "Continue" button is "SubmitButton" not just "Submit".

Also, when I go to that page I see you have:
<input type="hidden" name="memcounterh" value="session("r_memcounter")">
 
I believe that should be:
<input type="hidden" name="memcounterh" value="<%=session("r_memcounter")%>">

Open in new window

No thats the live page I have decided, the code posted is from my testing localhost server .
just wanted to make you have an idea
when I submit the form on the url you posted, it takes me to pre-register.asp. In pre-gister.asp you are collecting the contact info for ONE person only. So I don't understand why you are trying to loop. There are no multiple email address, city, zip, etc. So there would be at most one iteration. Furthermore, I see you have this on the code you posted:
txtfname=request.form("txtfname"&p)

but looking at the form of the url you provided, there is no field with:

<input name="txtfname1"...>
 
(or whatever number p turns out to be).

Open in new window

i am kinda new with asp classic, vb, so , you are telling me that i am looping somehow on pre-rsgister tooo con the code above?
i want to make this loop on register.asp page  not in this ,, how would I proceed

pre register.asp

<%
	level="../"
	'response.buffer=true
	'Response.ExpiresAbsolute = Now() - 1
 	'Response.Expires = 0
 	'Response.CacheControl = "no-cache"
 
%>
<!--#include file="../include/intialize.inc"-->
<!--include file="../include/connection.asp"-->
<!--#include file="../../Connections/sqlConn1.asp" -->
<!--#include file="../../Connections/sqlConn3.asp" -->
 
<!-- include File="../include/logincheck.asp" -->
<%
 
							  
If request.form("T_name")<>"" Then
tourname=request.form("T_name")
Else
tourname=request.form("tourname")
End If
'response.write "tourname--"& tourname
 
If request.form("T_Id")<>"" Then
	TID=request.form("T_Id")
Else
	TID=request.form("TID")
End If
 
'memcounter=request.form("memcounter")
'teamname= request.form("teamname"
 
' Member Registration
 
If (Request.Form("SubmitButton")<>"") Then
 
' Retrieving from the form 
 
tourname = request.form("tourName")
TID=request.form("TID")
mcount= request.form("memcounter")
teamname= request.form("txtteamname")
txtmainfname = request.form("txtleaderfname")
txtmainlname= request.form("txtleaderlname")
txtmaincontactno= request.form("txtleadercontactno")
txtmaincontactemail= request.form("txtleaderemailid")
txtleaderadd1 = request.form("txtleaderadd1") '
txtleadercity = request.form("txtleadercity")
txtleaderstate = request.form("txtleaderstate")
txtleaderzipcode = request.form("txtleaderzipcode")
txtleadershirtsize =request.form("txtleadershirtsize")	
txtleaderhandicap= request.form("txtleaderhandicap")
txtleaderhomecourse = request.form("txtleaderhomecourse")
txtleaderball =request.form("txtleaderball")		
txtleaderclub= request.form("txtleaderclub")
lregdate=date()
lregtime=time()
 
	set rs_val = Server.Createobject("ADODB.Recordset")
		ccnt=0
		c=0
 
		sql_res_val="select max(TIID) from players"         'Team ID 
		rs_val.open sql_res_val,conSQL
		if rs_val(0)<>""  Then
			TIID=rs_val(0)+1
		Else
			TIID=1000
		End if
 
conSQL.execute("Insert into Players ( TOURID,TIID, teamname, teammaincontactname, teammaincontactlastname, teammaincontactno, teammainemail,TeamTournamentMembers,firstname,lastname, addy1,city,state,Zip,phone,email,regdate,regtime,Shirtsize,Handicap,courseID,golfball,golfclub )  values ('"&TID&"','"&TIID&"','"&teamname&"','"&txtmainfname&"','"&txtmainlname&"','"&txtmaincontactno&"', '"&txtmaincontactemail&"','"&mcount&"','"&txtmainfname&"','"&txtmainlname&"','"&txtleaderadd1&"' ,'"&txtleadercity&"','"&txtleaderstate&"','"&txtleaderzipcode&"','"&txtmaincontactno&"','"&txtmaincontactemail&"','"&lregdate&"','"&lregtime&"','"&txtleadershirtsize&"','"&txtleaderhandicap&"','"&txtleaderhomecourse&"','"&txtleaderball&"','"&txtleaderclub&"')")
 
 
If Err.Number <> 0 Then
		Response.Write "Error: " & Err.Description
			    response.end
			Response.Write "Unable to Store your Information "
		response.end
 	
		end if
 
conSQL.execute("Update Players Set TeamLeader = 1 where teammaincontactname is not null ")
 
		session("s_memcounter") = mcount
		session("s_teamname") = Request.Form("txtteamname")
		session("s_tourname") = Request.Form("tourname")
		session("s_txtcourseid") = Request.Form("txtleaderhomecourse")
		session ("s_mainfname") = request.form("txtleaderfname")
		session ("s_mainlname") = request.form("txtleaderlname")
		session ("s_maincontactno") = request.form("txtleadercontactno")
		session("s_maincontactemail") = request.form("txtleaderemailid")
		session("s_TIID") = TIID
		session("s_TID") = TID
 
IF request.form("memcounter")=1 then
response.Redirect("thank.asp")
else 
RESPONSE.REDIRECT("REGISTER.ASP")		
end if
		
end if
%>
<html>
<head>
<title><%=PageTitle%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../style/style.css" rel="stylesheet" type="text/css">
</head>
<body background="<%=level%>images/bg.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="775" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="4" valign="top"><!--#include file="../include/header.asp"--></td>
  </tr>
  <tr>
    <td width="192" valign="top" bgcolor="#ffffff"><!-- #include file="../include/left.asp" --></td>
    <td width="591" valign="top" bgcolor="#ffffff">
  
      <form action="" method="post" name="form1" id="form1" >
      
      <input type = 'hidden' name = 'TourName' value = '<%=tourname%>' >
      <input type = 'hidden' name = 'TID' value = '<%=tid%>' >
      <input type = 'hidden' name = 'TIID' value = '<%=tiid%>' >
        
           
        <table width="88%" border="0" align="center" cellpadding="0" cellspacing="0" class="bodytxt1">
              <tr>
            <td width="100%" height="30" colspan="2" align="center" class="errortxt"><%=msg%></td>
          </tr>
    
        </table>
        <table width="423"  border="0" cellspacing="0" cellpadding="0" align="center" class="bodytxt1">
          <tr>
            <td width="28"><img src="<%=Level%>images/tbleft.jpg" width="28" height="24"></td>
            <td width="279" class="tableheader1">New User Sign Up &nbsp;for Tournament&nbsp;Step 1</td>
            <td width="116"><img src="<%=Level%>images/tbright.jpg" width="28" height="24"></td>
          </tr>
          <tr>
            <td colspan="3" valign="top" bgcolor="#5eb020">
              <table width="100%"  border="0" cellspacing="1" cellpadding="0" class="bodytxt1" >
                <tr>
                  <td valign="top" bgcolor="#FFFFFF" class="tablebgcolor"><br>
                  Please Select the Tournament Members :
				    <select name="memcounter" id="memcounter" >
                      <option value="1" <% if request.form("memcounter")=1 then Response.write "selected" %>>1</option>
                      <option value="2" <% if request.form("memcounter")=2 then Response.write "selected" %>>2</option>
                      <option value="3" <% if request.form("memcounter")=3 then Response.write "selected" %>>3</option>
                      <option value="4" <% if request.form("memcounter")=4 then Response.write "selected" %>>4</option>
                      <option value="4" <% if request.form("memcounter")=4 then Response.write "selected" %>>5</option>
                    </select>
				   <br>
                  <br></td>
                </tr>
				<tr>
                  <td valign="top" bgcolor="#FFFFFF" class="tablebgcolor">
				<table width="100%" height="100%" align="center" cellpadding="5" cellspacing="0" class="bodytxt1" >
                      <tr align="left">
                        <td colspan="2" class="tableheader" >Team Leader Contact Information                        </td>
                      </tr>
                      <tr>
                        <td align="right" >Team Name</td>
                        <td>  &nbsp;
                   <input name="txtteamname" type="text" class="txtbox1" id="txtteamname" size="20"></td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >First Name</td>
                        <td width="60%"> &nbsp;
 <input name="txtleaderfname" type="text" class="txtbox1" id="txtleaderfname"  onKeyDown="
   if ( !isAlpha ( event ) ) {
      alert ( 'Please enter only letters on this field .' );
      return false;
   }" >
 <img src="../images/golfclub.gif" alt="leadericon" width="17" height="19" longdesc="team leader "> </td>      
                      </tr>
                      <tr>
                        <td width="40%" align="right" >Last Name</td>
                        <td width="60%"> &nbsp;
                          <input name="txtleaderlname" type="text" class="txtbox1" id="txtleaderlname"  onKeyDown="
   if ( !isAlpha ( event ) ) {
      alert ( 'Please enter only letters on this field .' );
      return false;
   }"
                           VALUE=<%=request.form("txtlname")%> >                        </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >Contact Number</td>
                        <td width="60%"> &nbsp;
                          <input name="txtleadercontactno" type="text" class="txtbox1" id="txtleadercontactno" VALUE="<%=request.form("txtcontactno"&i)%>">                        </td>
                      </tr>
                      <tr>
 
                        <td align="right" >Email Address</td>
                        <td>&nbsp;	<input NAME="txtleaderemailid" type="text" class="combobox1" id="txtleaderemailid" VALUE="<%=request.form("txtemailid")%>"></td>
                      </tr>
                      
                      <tr>
 
                        <td align="right" >Address</td>
                        <td>&nbsp;	<input NAME="txtleaderadd1" type="text" class="combobox1" id="txtleaderadd1" VALUE="<%=request.form("txtemailid")%>"></td>
                      </tr>
                      
                      <tr>
 
                        <td align="right" >City</td>
                        <td>&nbsp;	<input NAME="txtleadercity" type="text" class="combobox1" id="txtleadercity" VALUE="<%=request.form("txtemailid")%>"></td>
                      </tr>
                      
                      <tr>
                        <td width="40%" align="right" >State</td>
                        <td width="60%"> &nbsp;
                        <select name="txtleaderstate"class="txtbox1"
                        value="<%=request.form("txtleaderstate")%>">
                            <option selected>--Choose a State--</option>
                            <option value="AL">Alabama</option>
                            <option value="AK">Alaska</option>
                            <option value="AZ">Arizona</option>
                            <option value="AR">Arkansas</option>
                            <option value="CA">California</option>
                            <option value="CO">Colorado</option>
                            <option value="CT">Connecticut</option>
                            <option value="DE">Delaware</option>
                            <option value="FL">Florida</option>
                            <option value="GA">Georgia</option>
                            <option value="HI">Hawaii</option>
                            <option value="ID">Idaho</option>
                            <option value="IL">Illinois</option>
                            <option value="IN">Indiana</option>
                            <option value="IA">Iowa</option>
                            <option value="KS">Kansas</option>
                            <option value="KY">Kentucky</option>
                            <option value="LA">Louisiana</option>
                            <option value="ME">Maine</option>
                            <option value="MD">Maryland</option>
                            <option value="MA">Massachusetts</option>
                            <option value="MI">Michigan</option>
                            <option value="MN">Minnesota</option>
                            <option value="MS">Mississippi</option>
                            <option value="MO">Missouri</option>
                            <option value="MT">Montana</option>
                            <option value="NE">Nebraska</option>
                            <option value="NV">Nevada</option>
                            <option value="NH">New Hampshire</option>
                            <option value="NJ">New Jersey</option>
                            <option value="NM">New Mexico</option>
                            <option value="NY">New York</option>
                            <option value="NF">Newfoundland</option>
                            <option value="NC">North Carolina</option>
                            <option value="ND">North Dakota</option>
                            <option value="OH">Ohio</option>
                            <option value="OK">Oklahoma</option>
                            <option value="OR">Oregon</option>
                            <option value="PA">Pennsylvania</option>
                            <option value="RI">Rhode Island</option>
                            <option value="SC">South Carolina</option>
                            <option value="SD">South Dakota</option>
                            <option value="TN">Tennessee</option>
                            <option value="TX">Texas</option>
                            <option value="UT">Utah</option>
                            <option value="VT">Vermont</option>
                            <option value="VA">Virginia</option>
                            <option value="WA">Washington</option>
                            <option value="DC">Washington, D.C.</option>
                            <option value="WV">West Virginia</option>
                            <option value="WI">Wisconsin</option>
                            <option value="WY">Wyoming</option>
                          </select>                        </td>
                      </tr>
                      
                      <tr>
 
                        <td align="right" >Zip Code</td>
                        <td>&nbsp;	<input NAME="txtleaderzipcode" type="text" class="combobox1" id="txtleaderzipcode" VALUE="<%=request.form("txtemailid")%>"></td>
                      </tr>
                      
                      <td align="right" >Shirt Size </td>
                        <td> &nbsp;
	<select name="txtleadershirtsize" id="txtleadershirtsize" width="18" VALUE="<%=request.form("txtshirtsize"&i)%>">
			  <option>Small</option>
			  <option>Medium</option>
			  <option>Large</option>
			  <option>X-Large</option>
			  <option>XX-Large</option>
			  <option>XXX-Large</option>
			  <option>Choose a Size</option>
						</select>                    </td>
                      </tr>
                                         <tr> 
                        <td height="25" align="right">
						  <span class="bodytxt1 Estilo2">Golf Ball Used</span></td>
                        <td height="25"><font face="Tahoma"><font size="2">&nbsp; 
                         
                          </font>
                            <SELECT name="txtleaderball" id="txtleaderball" width="14"onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
                              <option selected>Choose a Brand</option>
                              <option>Specials</option>
                              <option>Range &amp; Practise Balls</option>
                              <option>Callaway</option>
                              <option>Dunlop</option>
                              <option>Maxfli</option>
                              <option>Nike</option>
                              <option>Pinnacle</option>
                              <option>Precept</option>
                              <option>Prostaff</option>
                              <option>Slazenger</option>
                              <option>Srixon</option>
                              <option>Strata</option>
                              <option>Taylor Made</option>
                              <option>Titleist</option>
                              <option>Top Flite</option>
                              <option>Ultra</option>
                              <option>Wilson</option>
                              <option>Lady Balls</option>
                              <option>Coloured Balls</option>
                              <option>Bulk</option>
                          <option>Other</option>
                              
                              
                               Click Here
                                                      
                          </SELECT>
                                                     
                        </font></td>
                      </tr>
                       <tr> 
                        <td height="25" align="right">
						  <span class="bodytxt1">Golf Clubs Used</span></td>
                        <td height="25"><font face="Tahoma"><font size="2">&nbsp; 
                         
                         </font>
                            <SELECT id="LeftColumnNav1_lstManufacture1" width="16"onChange="ManuChange(1);" name="txtleaderclub">
                              <option value="Select a Manufacturer">Choose a Brand</option>
                              <option>Adams</option>
                              <option>Adidas</option>
                              <option>Affinity</option>
                              <option>Akira</option>
                              <option>Amf</option>
 
                              <option>Armor Gear</option>
                              <option>Aserta</option>
                              <option>Bag Boy</option>
                              <option>Ben Hogan</option>
                              <option>Bennington</option>
                              <option>Big Moss Golf</option>
                              <option>Bob Burns Golf</option>
                              <option>Bobby Jones</option>
                              <option>Booklegger</option>
                              <option>Bridgestone</option>
                              <option>Bullet</option>
                              <option>Burton</option>
                              <option>Bushnell</option>
                              <option>Caddydaddy</option>
                              <option>Caddyrack</option>
                              <option>Callaway</option>
                              <option>Cargo Golf</option>
                              <option>Cleveland</option>
                              <option>Clicgear</option>
                              <option>Club Glove</option>
                              <option>Cobra</option>
                              <option>Cougar</option>
                              <option>Daito Golf</option>
                              <option>Daiwa</option>
                              <option>Daphnes</option>
                              <option>Datrek</option>
                              <option>Dunlop</option>
                              <option>Ecco</option>
                              <option>Ernie Els</option>
                              <option>F2</option>
                              <option>Garmin</option>
                              <option>Gauge Design Putter</option>
                              <option>Golden Bear Golf</option>
                              <option>Golf Buddy</option>
                              <option>Golf Travel Bags</option>
                              <option>Great Dividers</option>
                              <option>Guerine Rife</option>
                              <option>Hawk</option>
                              <option>Heavy Putter</option>
                              <option>Hippo</option>
                              <option>Innovex Golf</option>
                              <option>Inside Approach</option>
                              <option>Intech</option>
                              <option>Izzo</option>
                              <option>Kasco</option>
                              <option>Keri Golf</option>
                              <option>La Jolla</option>
                              <option>Lady Fairway</option>
                              <option>Lectronic Kaddy</option>
                              <option>MacGregor</option>
                              <option>Maruman</option>
                              <option>Maxfli</option>
                              <option>Medicus</option>
                              <option>Miura</option>
                              <option>Mizuno</option>
                              <option>Momentus</option>
                              <option>Never Compromise</option>
                              <option>Nickent</option>
                              <option>Nicklaus Golf</option>
                              <option>Nike</option>
                              <option>Odyssey</option>
                              <option>Ogio</option>
                              <option>Orlimar</option>
                              <option>Paragon Golf</option>
                              <option>Path Pro Golf</option>
                              <option>Perfect Club</option>
                              <option>PinFire</option>
                              <option>Ping</option>
                              <option>Pinnacle</option>
                              <option>Porterline</option>
                              <option>PowerBilt</option>
                              <option>Precept</option>
                              <option>Pro Tour Memorabilia</option>
                              <option>Puma</option>
                              <option>QLink</option>
                              <option>Ram</option>
                              <option>Sabona</option>
                              <option>Samsonite</option>
                              <option>See More</option>
                              <option>SKB</option>
                              <option>SKLZ</option>
                              <option>Sky Golf</option>
                              <option>Solus Golf</option>
                              <option>Sonartec</option>
                              <option>Speed Stik</option>
                              <option>Square Two</option>
                              <option>Srixon</option>
                              <option>Stewart Golf</option>
                              <option>Sun Mountain</option>
                              <option>Sweet Spot Golf</option>
                              <option>TaylorMade</option>
                              <option>Team Effort</option>
                              <option>Telebag</option>
                              <option>Titleist</option>
                              <option>Tommy Armour</option>
                              <option>Top Flite</option>
                              <option>Tour Edge</option>
                              <option>Tour Links</option>
                              <option>TrionZ</option>
                              <option>Upro</option>
                              <option>Visionary Golf</option>
                              <option>Wilson</option>
                              <option>Winning Edge</option>
                              <option>Yes</option>
                              <option>Yonex</option>
                              <option>Zelocity</option>
                              <option>Other</option>
                          </SELECT>
</font></td>
  <tr>
                        <td align="right" >Handicap </td>
                        <td> &nbsp;
						<input name="txtleaderhandicap" type="text" class="combobox1" id="txtleaderhandicap" VALUE="<%=request.form("txthandicap"&i)%>"></td>
  </tr>
                       <tr>
                        <td width="40%" align="right" >Home Course </td>
                        <td width="60%"> &nbsp;
						<select name="txtleaderhomecourse" class="combobox1" id="txtleaderhomecourse">
                            <option value="">--Choose The Course--</option>
                            <%
							  set Rs_Course = conSQL.execute("select * from courses ORDER BY NAME")
							  while Not Rs_Course.Eof
								response.Write("<option value="&Rs_Course("CourseID")&">"&Rs_Course("Name")&"</option>")
								Rs_Course.MoveNext
							  wend
							  %>
                        </select>                        </td>
                      </tr>                                       
                      				
                      <tr align="center" >
                        <td colspan="2" >
                        						   
                      
                           <input type="hidden" name="memcounterh" value="session("r_memcounter")">                                    
                   
                  
                          <input name="SubmitButton" type="submit" class="button1" id="SubmitButton" onClick="return validate_all()" value="Continue"></td>
                      </tr>
</table>
                  </td>
				</tr>
              </table>
            </td>
          </tr>
        </table>
        <br>
        <br>
      </form>    </td>
    <td width="1" valign="top" bgcolor="#285E8E"></td>
    <!--
    <td width="161" valign="top" bgcolor="#FFFFFF">
      <!--include file="../include/right.asp"
    </td> -->
 
 
  </tr>
  <tr>
    <td colspan="4">
      <!--#include file="../include/footer.asp"-->
    </td>
  </tr>
</table>
</body>
</html>

Open in new window

register.asp


can you correct what you think is going wrong??

first pre- register should only take one iteration , from one player
and register.asp from whoever the counter value is, which is max 5

<%
	level="../"
	'response.buffer=true
	'Response.ExpiresAbsolute = Now() - 1
 	'Response.Expires = 0
	'Response.CacheControl = "no-cache"
%>
<!--#include file="../include/intialize.inc"-->
<!--include file="../include/connection.asp"-->
<!--#include file="../../Connections/sqlConn1.asp" -->
<!--#include file="../../Connections/sqlConn3.asp" -->
 
<!-- include File="../include/logincheck.asp" -->
<%
 
TID= session("s_TID")
'testtt = Request.Form("memcouter")
'response.write " the counter go in:" &testtt
 
dim cmd
set cmd = Server.CreateObject("AdoDB.Command")
'dim cn
'set cn = Server.CreateObject("AdoDb.Connection")
'cn.connectionString = MyconnectionString
 
set cmd.ActiveConnection = ConSQL
cmd.CommandText = "Select AvailableSpots From tblTournament WHERE TourID = "&TID&"  "
 
 if cmd.Execute().fields(0).Value > 0 then
 'There's an available spot ... claim it
 'cmd.CommandText = "Update tblTournament set MaxTeams = MaxTeams-1"
  
  cmd.CommandText = "Update tblTournament set AvailableSpots = AvailableSpots-1 WHERE TourID = "&TID&"  "
  cmd.Execute
  end if
    
	        'dim rsInfo
			'set rsInfo = server.createobject("ADODB.Recordset")
			'sqlInfo="select * from tblTournament where TourVerify=1 order by TourStartdate Desc"	
			'rsInfo.open sql,conSQL,1,1
			'if rsInfo.BOF then 
	         'conSQL.execute(" Select * from tblTournament where WHERE TourID = "&TID&"  ")
	
			'do while Not rs.EOF 
			'Tourname = rs("TourName")		
			'TourId = rs("TourID")
			'TourLoc=rs("TourLocation")	
			'stdate=rs("TourStartdate")
			
		      
  'Send Email to Leader First 
 
                   Set MyCDO1 =CreateObject("CDO.Message")
					MyCDO1.To = session("s_maincontactemail")	                    'MyCDO.Bcc=txtemaild
	                'MyCDO.Cc=txtemailid
 
	     MyCDO1.From ="info@playerscores.com"
	     MyCDO1.Subject = "Tournament signup confirmation from playerscores.com "
 
			        MyCDO1.HTMLBody = " <br><br>Thanks for registering your team<b> "& session("s_teamname")&"</b> online with the <b>"& session("s_tourname") &"</b><br> If you have any questions please do not hesitate to email us at info@playerscores.com  <br><br><br> <b>Tournament Information</b> : <> Tournament Name <BR>   Adress : <br> <br> Date: <br>  Person to contact :    <br> <br> Email: <br> 	<br>Thanks<br>PlayerScores.com Staff"
 
 
                    MyCDO1.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
					
					MyCDO1.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        MyCDO1.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "admin"
        MyCDO1.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "Microsoft"
                    'Name or IP of remote SMTP server
                    MyCDO1.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
                    ="127.0.0.1"
                    'Server port
                    MyCDO1.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
                    =25
					
                    MyCDO1.Configuration.Fields.Update
                    MyCDO1.Send
 
 
                    If Err.Number <> 0 Then
		                            Response.Write "Error: " & Err.Description
	                                response.end
	                end if		
					
					
  
 
' Member Registration
 
If (Request.Form("Submit")<>"") Then
	
		mcount2= session("s_memcounter")
		session("r_mcount") = mcount2
        response.write "tname :" & mcount2
	
		 For p=1 to mcount2
		 
		 	session("r_txtfname"&p) = Request.Form("txtfname"&p)
					session("r_txtlname"&p) = Request.Form("txtlname"&p)
					'session("r_txtemailid"&p) = Request.Form("txtemailid"&p)
		
														
					' Retrieve from session variable ???
					teamname=session("s_teamname")	
					tourname=session("s_tourname")
					TIID=session("s_TIID") 
					TID= session("s_TID")	' this works
					
					
					' this not	
					txtfname=request.form("txtfname"&p)
					txtlname=request.form("txtlname"&p)
					txtaddr1=request.form("txtaddr1"&p)
					txtaddr2=request.form("txtaddr2"&p)
					txtcity=request.form("txtcity"&p)
					txtstate=request.form("txtstate"&p)
					txtcourseid=request.form("txtcourseid"&p)
					txtpcode=request.form("txtpcode"&p)
					txtcontactno=request.form("txtcontactno"&p)
					txtemailid=request.form("txtemailid"&p)
					
					txtshirtsize=request.form("txtshirtsize"&p)
					txthandicap=request.form("txthandicap"&p)
					txthomecourse=request.form("txthomecourse"&p)
					txtball=request.form("txtball"&p)
					txtclub=request.form("txtclub"&p)
										
								
		'session("r_tourname")
 		session("r_mcount") = Request.Form("memcounter")
		session("r_tourname") = Request.Form("tourname")
		session("r_txtcourseid") = Request.Form("txtcourseid")
		'session("r_txttourid")= TID
		'mcoun2 = session("s_memcounter") 
							
					regdate=date()
					regtime=time()
				  
  'conSQL.execute(sql)
conSQL.execute("Insert into Players(teamname,firstname,lastname,addy1,addy2,city,state,Zip,phone,email,regdate,regtime,TourID,Shirtsize,Handicap,courseID,TIID,golfball,golfclub) values('"&teamname&"','"&txtfname&"','"&txtlname&"','"&txtaddr1&"','"&txtaddr2&"','"&txtcity&"','"&txtstate&"','"&txtpcode&"','"&txtcontactno&"','"&txtemailid&"','"&regdate&"','"&regtime&"','"&TID&"','"&txtshirtsize&"','"&txthandicap&"','"&txthomecourse&"','"&TIID&"','"&txtball&"','"&txtclub&"')")
					
					If Err.Number <> 0 Then
		Response.Write "Error: " & Err.Description
			    response.end
			Response.Write "Unable to Store your Information "
		response.end
 	
		end if
 
					Set rsNewListMember=Server.CreateObject("ADODB.Recordset")
 
					strSQL = "SELECT tblMailingList.* FROM tblMailingList;"
					rsNewListMember.Open strSQL, con3SQL
 
					Randomize Timer
						dim strEmailAdress
						strEmailAdress=""
			        strUserCode = Left(strEmailAddress,2) & (9876989856 * CInt((RND * 32000) + 100))
 
					Do While NOT rsNewListMember.EOF
 
				        If strUserCode = rsNewListMember("ID_Code") Then
 
					        Randomize Timer
 
					        strUserCode = Left(strEmailAddress,2) & (9876989856 * CInt((RND * 32000) + 100))
 
				        rsNewListMember.MoveFirst
				        End If
 
          
                        If strEmailAddress = txtemailid Then
                              blnError = True
                              Exit Do
                        End If
 
				        rsNewListMember.MoveNext
                    Loop
 
			        If strEmailAddress = txtemailid Then
				        blnError = True
		  'Exit Do
			        End If
 
                    Set MyCDO =CreateObject("CDO.Message")
					MyCDO.To = txtemailid
	                'MyCDO.Bcc=txtemaild
	                'MyCDO.Cc=txtemailid
 
	                MyCDO.From = "info@playerscores.com"
	                MyCDO.Subject = "Tournament signup confirmation from playerscores.com "
 
			        MyCDO.HTMLBody = " <br><br>Thanks for registering your team<b> "& request.form("txtteamname")&"</b> online with the <b>"& request.form("tourname") &"</b><br> If you have any questions please do not hesitate to email us at info@playerscores.com <br><br>Thanks<br>PlayerScores.com Staff"
 
          MyCDO.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
					
			MyCDO.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        MyCDO.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "admin"
        MyCDO.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "Microsoft"
                       'Name or IP of remote SMTP server
                    MyCDO.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
                    ="127.0.0.1"
                    'Server port
                    MyCDO.Configuration.Fields.Item _
                    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
                    =25
                    MyCDO.Configuration.Fields.Update
                    MyCDO.Send
 
                    If Err.Number <> 0 Then
		                            Response.Write "Error: " & Err.Description
	                                response.end
	                end if		        'Exit Do
						
	
		            If blnError = False Then
		                Set rsNewListMemberc = Server.CreateObject("ADODB.Recordset")
		                strSQLC = "SELECT * FROM tblMailingList where Email='"&txtemailid&"'"
		                rsNewListMemberC.Open strSQLC, con3SQL
	                    If rsNewListMemberC.EOF Then
                            con3SQL.execute("Insert into tblMailingList(Email,ID_Code) values('"&txtemailid&"','"&strUserCode&"')")
					    End If
				    End If
 
				    rsNewListMember.Close
				    Set rsNewListMember = Nothing
		Next
		
		' clean up
		set MyCDO=nothing
		url="thank.asp"
		response.redirect(url)
	end if
	
 
%>
<html>
<head>
<title><%=PageTitle%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function validate_all()
	{
		errmsg="";
	for(i=1;i<=document.regfrm.mcount2.value;i++)
	{
		//errmsg +="Player"+i+"\n\n";
		if (eval("document.regfrm.txtfname"+i+".value")=="")
			errmsg +="Player"+i+" Firstname Field is Blank \n";
		if (eval("document.regfrm.txtaddr1"+i+".value")=="")
			errmsg +="Player"+i+ " Address Field is Blank \n";
		if (eval("document.regfrm.txtcity"+i+".value")=="")
			errmsg +="Player"+i+ " City Field is Blank \n";
		if (eval("document.regfrm.txtstate"+i+".value")=="")
			errmsg +="Player"+i+ " State Field is Blank \n";
		if (eval("document.regfrm.txtpcode"+i+".value")=="")
			errmsg +="Player"+i+ " Zip Code Field is Blank \n";
		if (eval("document.regfrm.txtcontactno"+i+".value")=="")
			errmsg +="Player"+i+ " Contact Number Field is Blank \n";
		if (eval("document.regfrm.txtemailid"+i+".value")=="")
			errmsg +="Player"+i+ " Email ID Field is Blank \n";
		else
		{
			var err=0
			mailid = eval("document.regfrm.txtemailid"+i+".value");
			val=mailid.indexOf("@");
			if (val!=-1)
			{
			  val1=mailid.indexOf(".");
			  if (val1==-1)
				err=1;
			}
			else
				err=1;
 
			if (err==1)
				  errmsg +="Player"+i+ " Invalid Email ID \n";
		}
 
		if (eval("document.regfrm.txthandicap"+i+".value")=="")
			errmsg +="Player"+i+ " Handicap Field is Blank \n";
		if (eval("document.regfrm.txthomecourse"+i+".value")=="")
			errmsg +="Player"+i+ " Home Course Field is Blank \n";
 
	}
	if (errmsg=="")
	{
		return true;
	}
	else
	{
		alert(" Following Error Have Occured While Submiting This Form:\n\n"+errmsg);
		return false;
	}
}
</script>
 
 
<script language="JavaScript">
<!--
function isAlpha ( evt ) {
   var keyCode = evt.which ? evt.which : evt.keyCode;
   alpha = ( keyCode >= 'a'.charCodeAt ( ) &&
      keyCode <= 'z'.charCodeAt ( ) ) ||
      ( keyCode >= 'A'.charCodeAt ( ) &&
      keyCode <= 'Z'.charCodeAt ( ) ) ||
      ( keyCode >= 8 && keyCode <= 46 );
   return ( alpha );
}
 
function validateAlpha ( text ) {
   for ( c=0; c < text.length; c ++ ) {
      alpha = ( text.charCodeAt ( c ) >= 65 &&
         text.charCodeAt ( c ) <=90 ) ||
         ( text.charCodeAt ( c ) >= 97 &&
         text.charCodeAt ( c ) <=122 )
      if ( !alpha ) {
         alert ( 'No way, sorry.' );
         document.theForm.theField.select ( );
         return false;
      }
 
   }
   return true;
}
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
//-->
</script>
 
 
 
</head>
<body background="<%=level%>images/bg.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="775" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="4" valign="top"><!--#include file="../include/header.asp"--></td>
  </tr>
  <tr>
    <td width="192" valign="top" bgcolor="#ffffff"><!-- #include file="../include/left.asp" --></td>
    <td width="591" valign="top" bgcolor="#ffffff">
      <form name="regfrm" method="post" action="" >
        <table width="88%" border="0" align="center" cellpadding="0" cellspacing="0" class="bodytxt1">
          <% if (msg<>"") then %>
          <tr>
            <td width="100%" height="30" colspan="2" align="center" class="errortxt"><%=msg%></td>
          </tr>
          <% end if %>
        </table>
        <table width="423"  border="0" cellspacing="0" cellpadding="0" align="center" class="bodytxt1">
          <tr>
            <td width="28"><img src="<%=Level%>images/tbleft.jpg" width="28" height="24"></td>
            <td width="279" class="tableheader1">New User Sign Up &nbsp;for Tournament&nbsp;Step 2</td>
            <td width="116"><img src="<%=Level%>images/tbright.jpg" width="28" height="24"></td>
          </tr>
          <tr>
            <td colspan="3" valign="top" bgcolor="#5eb020">
              <table width="100%"  border="0" cellspacing="1" cellpadding="0" class="bodytxt1" >
				<tr>
                  <td valign="top" bgcolor="#FFFFFF" class="tablebgcolor">
				<%
				nct=session("s_memcounter")
				'nct=play
				if nct="" then
				nct= 1
				End if
				For i=2 to nct
				%>
				<table width="100%" height="100%" align="center" cellpadding="5" cellspacing="0" class="bodytxt1" >
                      <tr align="left">
                        <td colspan="2" class="tableheader" >Player<%=i%> Personal Information                        </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >Tournament Name</td>
                        <td width="60%"> <%=session("s_tourname")%>                        </td>
                      </tr>
                      <tr>
                      <td width="40%" align="right" >Team Name</td>         <td width="60%"> <%=session("s_teamname")%>                  </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >First Name</td>
                        <td width="60%"> &nbsp;
 <input type="text" name="txtfname<%=i%>" class="txtbox1"  onKeyDown="
   if ( !isAlpha ( event ) ) {
      alert ( 'Please enter only letters on this field .' );
      return false;
   }" >                        </td>      
                      </tr>
                      <tr>
                        <td width="40%" align="right" >Last Name</td>
                        <td width="60%"> &nbsp;
                          <input type="text" name="txtlname<%=i%>" class="txtbox1"  onKeyDown="
   if ( !isAlpha ( event ) ) {
      alert ( 'Please enter only letters on this field .' );
      return false;
   }" >                        </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >Address</td>
                        <td width="60%"> &nbsp;
     <input type="text" name="txtaddr1<%=i%>" class="txtbox2" VALUE="<%=request.form("txtaddr1"&i)%>">                        </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right">Address</td>
                        <td width="60%"> &nbsp;
                          <input type="text" name="txtaddr2<%=i%>" class="txtbox2" VALUE="<%=request.form("txtaddr2"&i)%>">                        </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >City </td>
                        <td width="60%"> &nbsp;
                          <input type="text" name="txtcity<%=i%>" class="txtbox1"  onKeyDown="
   if ( !isAlpha ( event ) ) {
      alert ( 'Please enter only letters on this field .' );
      return false;
   }"
                           VALUE=<%=request.form("txcity"&i)%> >                        </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >State</td>
                        <td width="60%"> &nbsp;
                        <select name="txtstate<%=i%>"class="txtbox1"
                        value="">
                            <option selected>--Choose a State--</option>
                            <option value="AL">Alabama</option>
                            <option value="AK">Alaska</option>
                            <option value="AZ">Arizona</option>
                            <option value="AR">Arkansas</option>
                            <option value="CA">California</option>
                            <option value="CO">Colorado</option>
                            <option value="CT">Connecticut</option>
                            <option value="DE">Delaware</option>
                            <option value="FL">Florida</option>
                            <option value="GA">Georgia</option>
                            <option value="HI">Hawaii</option>
                            <option value="ID">Idaho</option>
                            <option value="IL">Illinois</option>
                            <option value="IN">Indiana</option>
                            <option value="IA">Iowa</option>
                            <option value="KS">Kansas</option>
                            <option value="KY">Kentucky</option>
                            <option value="LA">Louisiana</option>
                            <option value="ME">Maine</option>
                            <option value="MD">Maryland</option>
                            <option value="MA">Massachusetts</option>
                            <option value="MI">Michigan</option>
                            <option value="MN">Minnesota</option>
                            <option value="MS">Mississippi</option>
                            <option value="MO">Missouri</option>
                            <option value="MT">Montana</option>
                            <option value="NE">Nebraska</option>
                            <option value="NV">Nevada</option>
                            <option value="NH">New Hampshire</option>
                            <option value="NJ">New Jersey</option>
                            <option value="NM">New Mexico</option>
                            <option value="NY">New York</option>
                            <option value="NF">Newfoundland</option>
                            <option value="NC">North Carolina</option>
                            <option value="ND">North Dakota</option>
                            <option value="OH">Ohio</option>
                            <option value="OK">Oklahoma</option>
                            <option value="OR">Oregon</option>
                            <option value="PA">Pennsylvania</option>
                            <option value="RI">Rhode Island</option>
                            <option value="SC">South Carolina</option>
                            <option value="SD">South Dakota</option>
                            <option value="TN">Tennessee</option>
                            <option value="TX">Texas</option>
                            <option value="UT">Utah</option>
                            <option value="VT">Vermont</option>
                            <option value="VA">Virginia</option>
                            <option value="WA">Washington</option>
                            <option value="DC">Washington, D.C.</option>
                            <option value="WV">West Virginia</option>
                            <option value="WI">Wisconsin</option>
                            <option value="WY">Wyoming</option>
                          </select>                        </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >Zip Code</td>
                        <td width="60%"> &nbsp;
                          <input name="txtpcode<%=i%>" type="text" class="txtbox1" id="txtpcode<%=i%>" tabindex="12" onBlur="MM_validateForm('txtpcode<%=i%>','','RisNum');return document.MM_returnValue" VALUE="<%=request.form("txtpcode"&i)%>" maxlength="5">                        </td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >Contact Number</td>
                        <td width="60%"> &nbsp;
                          <input name="txtcontactno<%=i%>" type="text" class="txtbox1" id="txtcontactno<%=i%>">                        </td>
                      </tr>
                      <tr>
 
                        <td align="right" >Email Address</td>
                        <td>&nbsp;	<input NAME="txtemailid<%=i%>" type="text" class="combobox1" id="txtemailid<%=i%>"></td>
                      </tr>
 
                      <tr>
                        <td align="right" >Shirt Size </td>
                        <td> &nbsp;
	<select name="txtshirtsize<%=i%>" width="3" VALUE="<%=request.form("txtshirtsize"&i)%>">
			  <option>Small</option>
			  <option>Medium</option>
			  <option>Large</option>
			  <option>X-Large</option>
			  <option>XX-Large</option>
			  <option>XXX-Large</option>
			  <option>Choose a Size</option>
						</select>                    </td>
                      </tr>
                                         <tr> 
                        <td height="25" align="right">
						  <span class="bodytxt1 Estilo2">Golf Ball Used</span></td>
                        <td height="25"><font face="Tahoma"><font size="2">&nbsp; 
                         
                          </font>
                            <SELECT name="txtball<%=i%>" id="txtball<%=i%>" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
                              <option selected>Choose a Brand</option>
                              <option>Specials</option>
                              <option>Range &amp; Practise Balls</option>
                              <option>Callaway</option>
                              <option>Dunlop</option>
                              <option>Maxfli</option>
                              <option>Nike</option>
                              <option>Pinnacle</option>
                              <option>Precept</option>
                              <option>Prostaff</option>
                              <option>Slazenger</option>
                              <option>Srixon</option>
                              <option>Strata</option>
                              <option>Taylor Made</option>
                              <option>Titleist</option>
                              <option>Top Flite</option>
                              <option>Ultra</option>
                              <option>Wilson</option>
                              <option>Lady Balls</option>
                              <option>Coloured Balls</option>
                              <option>Bulk</option>
                          <option>Other</option>
                              
                              
                               Click Here
                                                      
                          </SELECT>
                                                     
                        </font></td>
                      </tr>
                       <tr> 
                        <td height="25" align="right">
						  <span class="bodytxt1">Golf Clubs Used</span></td>
                        <td height="25"><font face="Tahoma"><font size="2">&nbsp; 
                         
                         </font>
                            <SELECT id="LeftColumnNav1_lstManufacture1" onChange="ManuChange(1);" name="txtclub<%=i%>">
                              <option value="Select a Manufacturer">Choose a Brand</option>
                              <option>Adams</option>
                              <option>Adidas</option>
                              <option>Affinity</option>
                              <option>Akira</option>
                              <option>Amf</option>
 
                              <option>Armor Gear</option>
                              <option>Aserta</option>
                              <option>Bag Boy</option>
                              <option>Ben Hogan</option>
                              <option>Bennington</option>
                              <option>Big Moss Golf</option>
                              <option>Bob Burns Golf</option>
                              <option>Bobby Jones</option>
                              <option>Booklegger</option>
                              <option>Bridgestone</option>
                              <option>Bullet</option>
                              <option>Burton</option>
                              <option>Bushnell</option>
                              <option>Caddydaddy</option>
                              <option>Caddyrack</option>
                              <option>Callaway</option>
                              <option>Cargo Golf</option>
                              <option>Cleveland</option>
                              <option>Clicgear</option>
                              <option>Club Glove</option>
                              <option>Cobra</option>
                              <option>Cougar</option>
                              <option>Daito Golf</option>
                              <option>Daiwa</option>
                              <option>Daphnes</option>
                              <option>Datrek</option>
                              <option>Dunlop</option>
                              <option>Ecco</option>
                              <option>Ernie Els</option>
                              <option>F2</option>
                              <option>Garmin</option>
                              <option>Gauge Design Putter</option>
                              <option>Golden Bear Golf</option>
                              <option>Golf Buddy</option>
                              <option>Golf Travel Bags</option>
                              <option>Great Dividers</option>
                              <option>Guerine Rife</option>
                              <option>Hawk</option>
                              <option>Heavy Putter</option>
                              <option>Hippo</option>
                              <option>Innovex Golf</option>
                              <option>Inside Approach</option>
                              <option>Intech</option>
                              <option>Izzo</option>
                              <option>Kasco</option>
                              <option>Keri Golf</option>
                              <option>La Jolla</option>
                              <option>Lady Fairway</option>
                              <option>Lectronic Kaddy</option>
                              <option>MacGregor</option>
                              <option>Maruman</option>
                              <option>Maxfli</option>
                              <option>Medicus</option>
                              <option>Miura</option>
                              <option>Mizuno</option>
                              <option>Momentus</option>
                              <option>Never Compromise</option>
                              <option>Nickent</option>
                              <option>Nicklaus Golf</option>
                              <option>Nike</option>
                              <option>Odyssey</option>
                              <option>Ogio</option>
                              <option>Orlimar</option>
                              <option>Paragon Golf</option>
                              <option>Path Pro Golf</option>
                              <option>Perfect Club</option>
                              <option>PinFire</option>
                              <option>Ping</option>
                              <option>Pinnacle</option>
                              <option>Porterline</option>
                              <option>PowerBilt</option>
                              <option>Precept</option>
                              <option>Pro Tour Memorabilia</option>
                              <option>Puma</option>
                              <option>QLink</option>
                              <option>Ram</option>
                              <option>Sabona</option>
                              <option>Samsonite</option>
                              <option>See More</option>
                              <option>SKB</option>
                              <option>SKLZ</option>
                              <option>Sky Golf</option>
                              <option>Solus Golf</option>
                              <option>Sonartec</option>
                              <option>Speed Stik</option>
                              <option>Square Two</option>
                              <option>Srixon</option>
                              <option>Stewart Golf</option>
                              <option>Sun Mountain</option>
                              <option>Sweet Spot Golf</option>
                              <option>TaylorMade</option>
                              <option>Team Effort</option>
                              <option>Telebag</option>
                              <option>Titleist</option>
                              <option>Tommy Armour</option>
                              <option>Top Flite</option>
                              <option>Tour Edge</option>
                              <option>Tour Links</option>
                              <option>TrionZ</option>
                              <option>Upro</option>
                              <option>Visionary Golf</option>
                              <option>Wilson</option>
                              <option>Winning Edge</option>
                              <option>Yes</option>
                              <option>Yonex</option>
                              <option>Zelocity</option>
                              <option>Other</option>
                          </SELECT>
</font></td>
                      </tr>
                      
                      
                      <tr>
                        <td align="right" >Handicap </td>
                        <td> &nbsp;
						<input type="text" name="txthandicap<%=i%>" class="combobox1" VALUE="<%=request.form("txthandicap"&i)%>"></td>
                      </tr>
                      <tr>
                        <td width="40%" align="right" >Home Course </td>
                        <td width="60%"> &nbsp;
						<select name="txthomecourse<%=i%>" class="combobox1">
                            <option value="">--Choose The Course--</option>
                            <%
							  set Rs_Course = conSQL.execute("select * from courses order by name")
							  while Not Rs_Course.Eof
			response.Write("<option value="&Rs_Course("CourseID")&">"&Rs_Course("Name")&"</option>")
								Rs_Course.MoveNext
							  wend
							  %>
                        </select>                        </td>
                      </tr>
					  <%
					  If int(i)=int(nct) Then %>
                      <tr align="center" >
                        <td colspan="2" >
					<input type="hidden" name="tourname" value="<%=tourname%>"> 
					 <input type="hidden" name="TID" value=<%=TID%>>
 
                          <input type="submit" name="Submit" value="Submit" class="button1" onClick="return validate_all()">
                          <input type="reset" name="Submit2" value="Reset" class="button1">                        </td>
                      </tr>
					  <% End If %>
                    </table>
               <%
			   Next
			   %>                  </td>
				</tr>
              </table>
            </td>
          </tr>
        </table>
        <br>
        <br>
      </form>    </td>
    <td width="1" valign="top" bgcolor="#285E8E"></td>
    <!--
    <td width="161" valign="top" bgcolor="#FFFFFF">
      <!--include file="../include/right.asp"
    </td> -->
 
 
  </tr>
  <tr>
    <td colspan="4">
      <!--#include file="../include/footer.asp"-->
    </td>
  </tr>
</table>
</body>
</html>

Open in new window

>>you are telling me that i am looping somehow on pre-rsgister tooo con the code above?
I don't know if the code you pasted on this problem description is for pre-register.asp or register.asp. But you are definitely Looping in the code you posted. That's what the For...Next construct does. On the url you posted I noticed that pre-register.asp is NOT submitting to register.asp since you have
form action=""

it will submit the data back to pre-register.asp, not to register.asp. If you want the data sent to register.asp you will need to specify that in the action:
form action="register.asp"
try fixing pre-register first. As pointed out earlier, in pre-register.asp, towards the bottom of the form you have:
<input type="hidden" name="memcounterh" value="session("r_memcounter")"> 
 
it should be:
<input type="hidden" name="memcounterh" value="<%=session("r_memcounter")%>"> 
 
also, it needs to submit to register.asp. Currenly it is NOT submitting the data to register.asp. You need to change:
<form action=""...>
 
to:
<form action="register.asp"...>

Open in new window

Why would I need to post to other page if my goal is not use any but 4 variables that i have previosuly saved in session variables.?
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I get now. I have changed my Pre-Register to post to register, I am getting the values with request form ( names on fields on pre - register), but, now , if this register form have some other fields,,,,, how do I called them,? like say I have request.form    (txtname)  --> get this from pre-register.asp and do something...
                     And I  have  a field name called txtcity on form ,  


Should i go request.form ("txtcity") ???????   would this grab the value on regristation and not pre-registration??
Looking at the link you provided, I see that in pre-register.asp you have:

<input name="txtleaderfname"..>
<input name="txtleaderlname"..>
 
so once you submit the form, the data in those fields will be sent to the page you specified in your form's action attribute:
<form action="register.asp" method="post">...</form>
 
Since the form in pre-register.asp has:
<form action="register.asp" method="post">...</form>
 
then that means that to obtain the values of the first and last name, you will need to use:
 
firstName = Request.Form("txtleaderfname")
lastName = Request.Form("txtleaderlname")
 
within register.asp because THAT is where pre-register.asp sent the information. I don't know if in your development server you have the text fields named identically, but if not, then you need to use the field names that you have in your form.

Open in new window

I understand now, so  , once i get the fields from pre-register I should be able to put
request.form ("opcode")
where opcode is  a field on form not on pre- register and would grab it?

 
If (Request.Form("Submit")<>"") Then
	
 
		For  p=1 to mcount
		
		
					session("r_txtfname"&p) = Request.Form("txtfname"&p)
					session("r_txtlname"&p) = Request.Form("txtlname"&p)
					session("r_txtemailid"&p) = Request.Form("txtemailid"&p)
					
					response.write "tname :" & session("r_txtfname"&p)
		
											
					txtfname=request.form("txtfname"&p)
					txtlname=request.form("txtlname"&p)
					txtaddr1=request.form("txtaddr1"&p)
					txtaddr2=request.form("txtaddr2"&p)
					txtcity=request.form("txtcity"&p)
					txtstate=request.form("txtstate"&p)
					txtcourseid=request.form("txtcourseid"&p)
					txtpcode=request.form("txtpcode"&p)
					txtcontactno=request.form("txtcontactno"&p)
					txtemailid=request.form("txtemailid"&p)
					txtshirtsize=request.form("txtshirtsize"&p)
					txthandicap=request.form("txthandicap"&p)
					txthomecourse=request.form("txthomecourse"&p)
					txtball=request.form("txtball"&p)
					txtclub=request.form("txtclub"&p)
							
					regdate=date()
					regtime=time()
					
					response.write "tname :" &txtemailid
  
  'conSQL.execute(sql)
conSQL.execute("Insert into Players(teamname,firstname,lastname,addy1,addy2,city,state,Zip,phone,email,regdate,regtime,TourID,Shirtsize,Handicap,courseID,TIID,golfball,golfclub) values('"&teamname&"','"&txtfname&"','"&txtlname&"','"&txtaddr1&"','"&txtaddr2&"','"&txtcity&"','"&txtstate&"','"&txtpcode&"','"&txtcontactno&"','"&txtemailid&"','"&regdate&"','"&regtime&"','"&TID&"','"&txtshirtsize&"','"&txthandicap&"','"&txthomecourse&"','"&TIID&"','"&txtball&"','"&txtclub&"')")

Open in new window

>>where opcode is  a field on form not on pre- register and would grab it?
Not quite. opcode could be anywhere. What you need to focus on are:
a. what fields were sent to your executing script (regardless of where the data was submitted from

Consider these examples:
Two page approach:
page1.asp
<html><body><form action="page2.asp" method="post">
<div>First name: <input type="first" value=""/></div>
<div>Last name: <input type="last" value=""/></div>
<div><input type="submit" name="Send" value="Submit"/></div>
</form></body></html>
 
page2.asp
<%
If "Submit" <> Request.Form("Send") Then
  Dim f, l
  f = Request.Form("first")
  l = Request.Form("last")
 
  Response.Write("Received:" & f & " " & l)
Else
  Response.Write("Form was not submitted")
End If
%>
 
 
Now consider this other example which submits to itself:
page3.asp
<%
If "Submit" <> Request("Send") Then
 Response.Write("Received: " & Request.Form("first") & " " & Request.Form("last") )
Response.End
End If
%>
<html><body><form action="page3.asp" method="post">
<div>First name: <input type="first" value=""/></div>
<div>Last name: <input type="last" value=""/></div>
<div><input type="submit" name="Send" value="Submit"/></div>
</form></body></html>
 
 
Lastly, there is the combo (which is most likely what you are doing), where pageX submits to pageY. PageY presents a follow-up form that submits to itself upon completion:

Open in new window

sorry, those:
type="first" and type="last" should have been:
name="first" and name="last"
So basically all i need is to used another request.form with fields I have in PageY and submitt to itself?

action="PageY"
Here is the X-Y interaction. Read through the comments:
pageX.asp
<html><body><form action="pageY.asp" method="post">
<div>First name: <input name="first" value=""/></div>
<div>Last name: <input name="last" value=""/></div>
<!-- Notice that the value of the Send submit button is NOT "Submit" anymore 
If both, pageX.asp and pageY.asp keep the value of the button as "Submit", then
in pageY.asp you will not know if the data was submitted from pageX.asp 
(when you are coming from pageX.asp you need to show the second part of the form)
OR if the data was submitted from pageY.asp (when this is the case the form as 
theoretically been completed and you can then process it)
 -->
<div><input type="submit" name="Send" value="Continue"/></div>
</form></body></html>
 
pageY.asp
<%
'notice that the value for the submit button in pageX.asp is "Continue"
'but in pageY.asp it is "Submit"
'So, if you see "Submit", then all the steps have been completed.
If "Submit" <> Request("Send") Then
 Dim f,l,a,c
 f=Request.Form("first")
 l=Request.Form("last")
 a=Request.Form("address")
 c=Request.Form("city")
 
 Response.Write("Received: " & f & " " & l & " " & a & " " & c)
Response.End
End If
%>
<html><body><form action="pageY.asp" method="post">
<!-- 
use hidden variable to "retain" the variables/data from pageX
so that once this page's form is submitted, everything will be avaible at once
 -->
<div><input name="first" value='<%=Request.Form("first")%>'/></div>
<div><input name="last" value='<%=Request.Form("last")%>'/></div>
 
<div>Address: <input name="address" value=""/></div>
<div>City: <input name="city" value=""/></div>
<div><input type="submit" name="Send" value="Submit"/></div>
</form></body></html>

Open in new window

I am more than lost now. Would you be able explain this with my actual variables so I can learn what is that i do wrong?
>>I am more than lost now.
Did you save the "pages" I posted and try them out so you can actually see how they work? I kept the examples short so that when you execute those pages you can see clearly what is going on.

>>Would you be able explain this with my actual variables so I can learn what is that i do wrong?
What are are describing/requesting requires a simple substitution of your variable names into what I posted. To really understand/learn, you will need to actually save the examples  I posted and see how the pages interact, especially the last example.
Yes I save what you told me to do, but my question is how do i request inside the
If "Submit" <> Request("Send") Then
 Dim f,l,a,c
 f=Request.Form("first")
 l=Request.Form("last")
 a=Request.Form("address")
 c=Request.Form("city")
end if

The values from actual form Y not the X
>>my question is how do i request inside the ...The values from actual form Y not the X
OK, what you need to understand is that the browser does NOT tell the server "this set of data came from this particular form". The browser NEVER sends the form name to the server. So YOU(the programmer) need to look at your form and figure out which fields you are interested in and "read" only the values that you need. If you look at my post ID: 22951769, pageX.asp has fields "first" and "last" only. By contrast, pageY.asp has fields: "first", "last", "address", and "city". However, in pageY.asp, the user does NOT get the chance to modify "first" and "last" because they are hidden fields. So essentially the form in pageY.asp will just "pass/carry" the values that came from pageX.asp to where ever it is that the action of pageY.asp is set. Since pageY.asp submits to itself, then will have ALL the field values.

>> not the X
Well if you do not want/need to do anything with the values from pageX.asp, then just "ignore" that data.  YOU (the programmer) need to know which fields you have on which form, and use the fields that you need when you need them. Since you do not want the values from pageX.asp, the modified code would just be:
If "Submit" <> Request("Send") Then
 Dim f,l,a,c
 a=Request.Form("address")
 c=Request.Form("city")
end if

In other words, if I give you 5 dollar bills so you can buy whatever you want, it does NOT mean you have to spend all 5 dollars when you go shopping!!!
So, I am doing it right but hte problem relies in something else.

this is the code
If "Submit" <> Request("Send") Then
	
' Retrieving from the pre-registration form 
	set rs_val = Server.Createobject("ADODB.Recordset")
		ccnt=0
		c=0
 
		sql_res_val="select max(TIID) from players"         'Team ID 
		rs_val.open sql_res_val,conSQL
		if rs_val(0)<>""  Then
			TIID=rs_val(0)+1
		Else
			TIID=1000
		End if
 
tourname = request.form("tourName")
TID=request.form("TID")
mcount= request.form("memcounter")
teamname= request.form("txtteamname")
txtmainfname = request.form("txtleaderfname")
txtmainlname= request.form("txtleaderlname")
txtmaincontactno= request.form("txtleadercontactno")
txtmaincontactemail= request.form("txtleaderemailid")
txtleaderadd1 = request.form("txtleaderadd1") '
txtleadercity = request.form("txtleadercity")
txtleaderstate = request.form("txtleaderstate")
txtleaderzipcode = request.form("txtleaderzipcode")
txtleadershirtsize =request.form("txtleadershirtsize")	
txtleaderhandicap= request.form("txtleaderhandicap")
txtleaderhomecourse = request.form("txtleaderhomecourse")
txtleaderball =request.form("txtleaderball")		
txtleaderclub= request.form("txtleaderclub")
lregdate=date()
lregtime=time()
 
 
 
 
conSQL.execute("Insert into Players ( TOURID,TIID, teamname, teammaincontactname, teammaincontactlastname, teammaincontactno, teammainemail,TeamTournamentMembers,firstname,lastname, addy1,city,state,Zip,phone,email,regdate,regtime,Shirtsize,Handicap,courseID,golfball,golfclub )  values ('"&TID&"','"&TIID&"','"&teamname&"','"&txtmainfname&"','"&txtmainlname&"','"&txtmaincontactno&"', '"&txtmaincontactemail&"','"&mcount&"','"&txtmainfname&"','"&txtmainlname&"','"&txtleaderadd1&"' ,'"&txtleadercity&"','"&txtleaderstate&"','"&txtleaderzipcode&"','"&txtmaincontactno&"','"&txtmaincontactemail&"','"&lregdate&"','"&lregtime&"','"&txtleadershirtsize&"','"&txtleaderhandicap&"','"&txtleaderhomecourse&"','"&txtleaderball&"','"&txtleaderclub&"')")
 
conSQL.execute("Update Players Set TeamLeader = 1 where teammaincontactname is not null ")
 
' Now Try to Grab from this page fields
 
 
		'session("r_txtuname")=request.form("txtuname")
		For  p=1 to request.form("memcounter") -1
		
	'	session("s_TIID") = TIID
		'session("s_TID") = TID
		
					session("r_txtfname"&p) = Request.Form("txtfname"&p)
					session("r_txtlname"&p) = Request.Form("txtlname"&p)
					session("r_txtemailid"&p) = Request.Form("txtemailid"&p)
					
					response.write "tname :" & session("r_txtfname"&p)
													
					txtfname=request.form("txtfname"&p)
					txtlname=request.form("txtlname"&p)
					txtaddr1=request.form("txtaddr1"&p)
					txtaddr2=request.form("txtaddr2"&p)
					txtcity=request.form("txtcity"&p)
					txtstate=request.form("txtstate"&p)
					txtcourseid=request.form("txtcourseid"&p)
					txtpcode=request.form("txtpcode"&p)
					txtcontactno=request.form("txtcontactno"&p)
					txtemailid=request.form("txtemailid"&p)
					txtshirtsize=request.form("txtshirtsize"&p)
					txthandicap=request.form("txthandicap"&p)
					txthomecourse=request.form("txthomecourse"&p)
					txtball=request.form("txtball"&p)
					txtclub=request.form("txtclub"&p)
							
					regdate=date()
					regtime=time()
					

Open in new window

From what I have seen so far, it seems you are correctly carrying data from page to page. Now may I ask, what is the purpose of the sessions? What are you saving there? It seems to me that if you start at pageX.asp and if you eventually arrive at pageY.asp, then reading the values would be the easy part. The question is, are you seeing all the FORM values? If yes, then perhaps your problem lies in that you may be not be setting some session variable on a previous form/page so when you go to your last page you do not see/get the expected values.
actually session variables are the only fields that i do can grab from pre-form , but not the fields on form,
I just noticed that SOME files are included correctly, while others are NOT included at all. If you look closer:

<!--#include file="../include/intialize.inc"-->
<!--include file="../include/connection.asp"-->
<!--#include file="../../Connections/sqlConn1.asp" -->
<!--#include file="../../Connections/sqlConn3.asp" -->
 
<!-- include File="../include/logincheck.asp" -->
 
connection.asp and logincheck.asp are NOT included as part of the script. You are missing the "#" symbol. Not sure if you did this intentionally.

Open in new window

Yes is intentionally for testing purposes, logincheck would check everytime i test the code for login password,
OK, let me see what I can put together...
This is illogical and I believe this is the reason for your problems:


For  p=1 to request.form("memcounter") -1		
	'session("s_TIID") = TIID
	'session("s_TID") = TID
	session("r_txtfname"&p) = Request.Form("txtfname"&p)
	session("r_txtlname"&p) = Request.Form("txtlname"&p)
	session("r_txtemailid"&p) = Request.Form("txtemailid"&p)
			
	response.write "tname :" & session("r_txtfname"&p)
	txtfname=request.form("txtfname"&p)
	txtlname=request.form("txtlname"&p)
...
Next
 
In pre-register.asp you have a select field with name = 'memcounter" which may have any value from 1...5, depending on the selection. So, your For construct indicates you want to do "something" X number of times, where X is dependent on the value of memcounter. For the sake of argument, let's say that memcounter is 5.
 
Since p starts at 1, the first time around, this:
session("r_txtfname"&p) = Request.Form("txtfname"&p)
 
is equivalent to:
session("r_txtfname1") = Request.Form("txtfname1")
 
Two issues here:
1. If you look at your form again, the name of your field is:
name="txtleaderfname"
 
NOT name="txtfname". Basically the word "leader" is missing. Since pre-register.asp submits to register.asp, then you need to pay attention at what your fieldname in pre-register.asp is because register.asp is "receiving" whatever name you used in pre-register.asp
 
2. Even if you had NOT left out the word "leader" - meaning, that even if you had used this:
session("r_txtfname"&p) = Request.Form("txtleaderfname"&p)
 
that is still equivalent to:
session("r_txtfname1") = Request.Form("txtleaderfname1")
when p=1
 
and:
session("r_txtfname2") = Request.Form("txtleaderfname2")
when p=2, etc
 
the problem is that in pre-register.asp, your field names do not end in a number (except for name="txtleaderadd1". I don't know why, but it is definitely not consistent with the other fields).
 
So, that leads us to the email issue:
txtemailid=request.form("txtemailid"&p)
 
there is NO field with:
name="txtemailidX", where X is any of 1,...,5. 
Since such fields do not exist in pre-register.asp, essentially on every iteration txtemail is set to an empty string. Hence the reason for the error message.
 
Technically speaking, getting rid of those "&p" should make the variables contain the values supplied in pre-register.asp:
 
For p=1 to session("s_memcounter")
	session("r_txtfname") = Request.Form("txtfname")
	session("r_txtlname") = Request.Form("txtlname")
	session("r_txtemailid") = Request.Form("txtemailid")
	response.write "tname :" & session("r_txtfname")
								' Retrieve from session variable ???
	teamname=session("s_teamname")	
	tourname=session("s_tourname")
	TIID=session("s_TIID") 
	TID= session("s_TID")
	txtfname=request.form("txtfname")
	txtlname=request.form("txtlname")
	txtaddr1=request.form("txtaddr1")
	txtaddr2=request.form("txtaddr2")
	txtcity=request.form("txtcity")
	txtstate=request.form("txtstate")
	txtcourseid=request.form("txtcourseid")
	txtpcode=request.form("txtpcode")
	txtcontactno=request.form("txtcontactno")
	txtemailid=request.form("txtemailid")
	txtshirtsize=request.form("txtshirtsize")
	txthandicap=request.form("txthandicap")
	txthomecourse=request.form("txthomecourse")
	txtball=request.form("txtball")
	txtclub=request.form("txtclub")
...
Next
 
However, I don't understand why you think you need to use a For/Next construct to begin with. In other words, I don't understand what you are trying to do. I DO know that using the For/Next to extract form values from pre-register.asp is NOT correct considering what you have in pre-register.
 
It's possible that perhaps you meant to query the db and iterate over a db recordset resutlts, but that is just speculation on my part, since I don't really understand what is the siginificance of "memcounter".

Open in new window

Wow. I thought that last explanation was worthy of a better grade than was given :(