Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How Do I Mix Dreamweaver transaction code with my own code

Posted on 2009-02-24
27
Medium Priority
?
433 Views
Last Modified: 2012-05-06
Hello experts, I am trying to modify add more things to dreamweaver toolbox generated code, but I am just lost. I want to request from the form extra data to be inserted on my database, please look in this code, . How can I do this? Where do I put my code, or how do I mix this right..
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
 
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_sqlConn1_STRING
rs1_cmd.CommandText = "SELECT * FROM dbo.League WHERE LeagueID = ?" 
rs1_cmd.Prepared = true
rs1_cmd.Parameters.Append rs1_cmd.CreateParameter("param1", 5, 1, -1, rs1__MMColParam) ' adDouble
 
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
 
 
 
<%
Dim Repeat1__numRows
Dim Repeat1__index
 
Repeat1__numRows = -1
Repeat1__index = 0
rsLeagueGolfers_numRows = rsLeagueGolfers_numRows + Repeat1__numRows
%>
<%
' Make an insert transaction instance 
Dim ins_LeagueGolfers: Set ins_LeagueGolfers = new tNG_multipleInsert
ins_LeagueGolfers.init MM_sqlConn1_STRING
tNGs.addTransaction ins_LeagueGolfers
' Register triggers
ins_LeagueGolfers.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1")
ins_LeagueGolfers.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)
ins_LeagueGolfers.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "loggedmain.asp")
' Add columns
ins_LeagueGolfers.setTable "LeagueGolfers"
ins_LeagueGolfers.addColumn "FirstName", "STRING_TYPE", "POST", "FirstName", ""
ins_LeagueGolfers.addColumn "Active_Usr", "NUMERIC_TYPE", "POST", "txtactive", ""
ins_LeagueGolfers.addColumn "LeagueAdmin", "NUMERIC_TYPE", "POST", "txtleagueadmin", ""
ins_LeagueGolfers.addColumn "PlayerName", "STRING_TYPE", "POST", "txtfullname", ""
ins_LeagueGolfers.addColumn "AccessLevel", "NUMERIC_TYPE", "POST", "txtaccesslevel", ""
ins_LeagueGolfers.addColumn "LeagueName", "STRING_TYPE", "POST", "txtleaguename", ""
ins_LeagueGolfers.addColumn "UserName", "STRING_TYPE", "POST", "txtUsername", ""
ins_LeagueGolfers.addColumn "Password", "STRING_TYPE", "POST", "txtPassword", ""
ins_LeagueGolfers.addColumn "LastName", "STRING_TYPE", "POST", "LastName", ""
ins_LeagueGolfers.addColumn "LeagueID", "STRING_TYPE", "GET", "League", ""
ins_LeagueGolfers.addColumn "Gender", "STRING_TYPE", "POST", "Gender", ""
ins_LeagueGolfers.addColumn "Title", "STRING_TYPE", "POST", "Title", ""
ins_LeagueGolfers.addColumn "City", "STRING_TYPE", "POST", "txtCity", ""
ins_LeagueGolfers.addColumn "State", "STRING_TYPE", "POST", "State", ""
ins_LeagueGolfers.addColumn "ZipCode", "STRING_TYPE", "POST", "ZipCode", ""
ins_LeagueGolfers.addColumn "Email", "STRING_TYPE", "POST", "Email", ""
ins_LeagueGolfers.addColumn "HomePhone", "STRING_TYPE", "POST", "HomePhone", ""
ins_LeagueGolfers.addColumn "WorkPhone", "STRING_TYPE", "POST", "WorkPhone", ""
ins_LeagueGolfers.setPrimaryKey "LeagueID", "NUMERIC_TYPE", "", ""
%>
 
 
<br />
 
 
<%
' trying to add more stuff and declare vars
 
fullname = request.form("firstname") + request.form("lastname")
golfleaguename = rs1.Fields.Item("LeagueName").Value
If  request.form("txtaccesslevel") = "user"  Then 
 
is_admin = 1 
else 
is_admin = 0 
 
End If 
 
%>
 
 
<%
 
'Execute all the registered transactions
tNGs.executeTransactions
%>
<%
'Get the transaction recordset
Dim rsLeagueGolfers
Dim rsLeagueGolfers_numRows
 
Set rsLeagueGolfers = tNGs.getRecordset("LeagueGolfers")
rsLeagueGolfers_numRows = 0
%>
<%
Dim rsLeagueGolfers_total
rsLeagueGolfers_total = KT_getNumberOfRows(rsLeagueGolfers)
%>

Open in new window

0
Comment
Question by:RickyGtz
  • 12
  • 10
  • 5
27 Comments
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23725453
what exactly do you want to be inserted?
You are already doing these:
==========
FirstName
txtactive
txtleagueadmin
txtfullname
txtaccesslevel
txtleaguename
txtUsername
txtPassword
LastName
League
Gender
Title
txtCity
State
iZipCode
Email
HomePhone
WorkPhone
==========

Do they succefully get inserted into the db?
Please explain a little more of what you are needing, and I will be more then happy to assist
BUT it will not be with this code, it will be with the typical code that I usually provide to you.

Carrzkiss
0
 

Author Comment

by:RickyGtz
ID: 23725492
I will appreciatge if someone can take a look to this actual code. the thing is is already workng 90 % and due time constraint I cant write the form now.

after line 61 : i beggin wrting cocde to get the rest of rom fields but is not working, i am seeking how to insert those as well
<%
' trying to add more stuff and declare vars
 
fullname = request.form("firstname") + request.form("lastname")
golfleaguename = rs1.Fields.Item("LeagueName").Value
If  request.form("txtaccesslevel") = "user"  Then 
 
is_admin = 1 
else 
is_admin = 0 
 
End If 
 
%>

Open in new window

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 23725513
>> How Do I Mix Dreamweaver transaction code with my own code

You don't.  At least not with Toolbox-generated code.  It's designed to be hard/impossible to deal with in code view and the intent of the designers is that you should only use the Wizards to muck about.

>>  I want to request from the form extra data to be inserted on my database

You would have to create a custom insert transaction that fires off the same trigger (form button) as the initial transaction and inserts the desired data to the second table.  

Now, your next question will probably be something along the lines of "show me how to do that" and I can't as I don't have the Toolbox currently installed with CS4.  But if you go through the Server Behavior menu, you will see the Custom option and from there you can get to the help file and read up on how to do it.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:RickyGtz
ID: 23725554
>> I can't find the Custom option??
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 1200 total points
ID: 23725578
Add Server Behavior | Developer Tool Box | Forms | Advanced | Custom Trigger or Custom Transaction
0
 

Author Comment

by:RickyGtz
ID: 23725748
ohw do this look I tried adding a custom insert

is there any tool better and more user friendly to handle form submission, inserte delete, login , other than developer toolbox?
<%
' Make an insert transaction instance 
Dim customTransaction: Set customTransaction = new tNG_custom
customTransaction.init MM_sqlConn1_STRING
tNGs.addTransaction customTransaction
' Register triggers
customTransaction.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Custom1")
' Set custom transaction SQL
customTransaction.setSQL "Insert Into League Golfers (PlayerName) Values ('"&txtfullname&"')"
' Add columns
customTransaction.addColumn "fullname", "STRING_TYPE", "POST", "txtfullname", ""
' End of custom transaction instance
%>
<%
' Make an insert transaction instance 
Dim ins_LeagueGolfers: Set ins_LeagueGolfers = new tNG_multipleInsert
ins_LeagueGolfers.init MM_sqlConn1_STRING
tNGs.addTransaction ins_LeagueGolfers
' Register triggers
ins_LeagueGolfers.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1")
ins_LeagueGolfers.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)
ins_LeagueGolfers.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "loggedmain.asp")
' Add columns
ins_LeagueGolfers.setTable "LeagueGolfers"
ins_LeagueGolfers.addColumn "FirstName", "STRING_TYPE", "POST", "FirstName", ""
ins_LeagueGolfers.addColumn "Active_Usr", "NUMERIC_TYPE", "POST", "txtactive", ""
ins_LeagueGolfers.addColumn "LeagueAdmin", "NUMERIC_TYPE", "POST", "txtleagueadmin", ""
ins_LeagueGolfers.addColumn "PlayerName", "STRING_TYPE", "POST", "txtfullname", ""
ins_LeagueGolfers.addColumn "AccessLevel", "NUMERIC_TYPE", "POST", "txtaccesslevel", ""
ins_LeagueGolfers.addColumn "LeagueName", "STRING_TYPE", "POST", "txtleaguename", ""
ins_LeagueGolfers.addColumn "UserName", "STRING_TYPE", "POST", "txtUsername", ""
ins_LeagueGolfers.addColumn "Password", "STRING_TYPE", "POST", "txtPassword", ""
ins_LeagueGolfers.addColumn "LastName", "STRING_TYPE", "POST", "LastName", ""
ins_LeagueGolfers.addColumn "LeagueID", "STRING_TYPE", "GET", "League", ""
ins_LeagueGolfers.addColumn "Gender", "STRING_TYPE", "POST", "Gender", ""
ins_LeagueGolfers.addColumn "Title", "STRING_TYPE", "POST", "Title", ""
ins_LeagueGolfers.addColumn "City", "STRING_TYPE", "POST", "txtCity", ""
ins_LeagueGolfers.addColumn "State", "STRING_TYPE", "POST", "State", ""
ins_LeagueGolfers.addColumn "ZipCode", "STRING_TYPE", "POST", "ZipCode", ""
ins_LeagueGolfers.addColumn "Email", "STRING_TYPE", "POST", "Email", ""
ins_LeagueGolfers.addColumn "HomePhone", "STRING_TYPE", "POST", "HomePhone", ""
ins_LeagueGolfers.addColumn "WorkPhone", "STRING_TYPE", "POST", "WorkPhone", ""
ins_LeagueGolfers.setPrimaryKey "LeagueID", "NUMERIC_TYPE", "", ""
%>

Open in new window

0
 

Author Comment

by:RickyGtz
ID: 23725927
it seems I am only missing iniserting fullname orm field on my database. Am I doing something wrong?
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23725937
Then  you will need to add the field of: FullName to your database.
0
 

Author Comment

by:RickyGtz
ID: 23725962
I want to insert into playername
valuer  (fullname)
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23725964
sorry, misunderstood.

Shouldn't you be able to do something like this

ins_LeagueGolfers.addColumn "FullName", "STRING_TYPE", "POST", "FullName", ""
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 23725973
>> is there any tool better and more user friendly to handle form submission, inserte delete, login , other than
>> developer toolbox?

There is no better option than learning to write your own code because you control everything.

That being said, look into Web Assist as a replacement if you don't want to write your own code.  It is more user-friendly and has most of the same features.  It is not free, however.
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23725985
Why aint it working?
Are you getting an error?
What does the script do when you run it?
0
 

Author Comment

by:RickyGtz
ID: 23726032
I dont get any error. Just doesnt insert properly, is weird
now

is_admin does get inserted in the transaction but not fullname..

>> jason >>

What tool allows me to do the same stuff from webasists, in which version ?
<%
' trying to add more stuff and declare vars
 
fullname = request.form("firstname") + request.form("lastname")
golfleaguename = rs1.Fields.Item("LeagueName").Value
If  request.form("txtaccesslevel") = "user"  Then 
 
is_admin = 1 
else 
is_admin = 0 
 
End If 
 
%>

Open in new window

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 23726131
Data Assist.  

Call them or email them to figure out the best version.  They may be dropping/have dropped ASP support.
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23726144
I hate this code.
Jason, maybe you can tell Ricky.

We need to see the SQL Output, Where would he put that at in order to write the SQL to the screen?

response.write SQL & "<br />"
0
 

Author Comment

by:RickyGtz
ID: 23726241
oopps,  >>is_admin does get inserted in the transaction but not fullname..

no it is not, just checked, yest I may quit using dreamweaver toolbox, just want to finish this prject..
this is the code,,,

can you guys point out what to do that would be equally to request.form  the fields I want,,,


<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../../Connections/sqlConn1.asp" -->
<!--#include file="../../includes/common/KT_common.asp" -->
<!--#include file="../../includes/nxt/KT_back.asp" -->
<!--#include file="../../includes/tNG/tNG.inc.asp" -->
<%
P_League = request.QueryString("League")
'session ("P_LeagueID") =request.QueryString("LeagueID")
 
'Make a transaction dispatcher instance
Dim tNGs: Set tNGs = new tNG_dispatcher
tNGs.Init "../../"
%>
 
<%
' Start trigger
Dim formValidation: Set formValidation = new tNG_FormValidation
formValidation.Init
formValidation.addField "FirstName", true, "text", "", "", "", ""
formValidation.addField "UserName", true, "text", "", "", "", ""
formValidation.addField "Password", true, "text", "", "", "", ""
formValidation.addField "LastName", true, "text", "", "", "", ""
formValidation.addField "State", true, "text", "", "", "", ""
formValidation.addField "Email", true, "text", "email", "", "", ""
formValidation.addField "HomePhone", false, "text", "phone", "", "", ""
tNGs.prepareValidation formValidation
' End trigger
%>
<%
Dim rs1__MMColParam
rs1__MMColParam = "1"
If (Request.QueryString("League") <> "") Then 
  rs1__MMColParam = Request.QueryString("League")
End If
%>
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
 
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_sqlConn1_STRING
rs1_cmd.CommandText = "SELECT * FROM dbo.League WHERE LeagueID = ?" 
rs1_cmd.Prepared = true
rs1_cmd.Parameters.Append rs1_cmd.CreateParameter("param1", 5, 1, -1, rs1__MMColParam) ' adDouble
 
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
 
 
 
<%
Dim Repeat1__numRows
Dim Repeat1__index
 
Repeat1__numRows = -1
Repeat1__index = 0
rsLeagueGolfers_numRows = rsLeagueGolfers_numRows + Repeat1__numRows
%>
<%
' Make an insert transaction instance 
Dim customTransaction: Set customTransaction = new tNG_custom
customTransaction.init MM_sqlConn1_STRING
tNGs.addTransaction customTransaction
' Register triggers
customTransaction.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Custom1")
' Set custom transaction SQL
customTransaction.setSQL "Insert Into LeagueGolfers (PlayerName) Values ('"&txtfullname&"')"
' Add columns
customTransaction.addColumn "fullname", "STRING_TYPE", "POST", "txtfullname", ""
' End of custom transaction instance
%>
<%
' Make an insert transaction instance 
Dim ins_LeagueGolfers: Set ins_LeagueGolfers = new tNG_multipleInsert
ins_LeagueGolfers.init MM_sqlConn1_STRING
tNGs.addTransaction ins_LeagueGolfers
' Register triggers
ins_LeagueGolfers.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1")
ins_LeagueGolfers.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)
ins_LeagueGolfers.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "loggedmain.asp")
' Add columns
ins_LeagueGolfers.setTable "LeagueGolfers"
ins_LeagueGolfers.addColumn "FirstName", "STRING_TYPE", "POST", "FirstName", ""
ins_LeagueGolfers.addColumn "Active_Usr", "NUMERIC_TYPE", "POST", "txtactive", ""
ins_LeagueGolfers.addColumn "LeagueAdmin", "NUMERIC_TYPE", "POST", "txtleagueadmin", ""
ins_LeagueGolfers.addColumn "AccessLevel", "NUMERIC_TYPE", "POST", "txtaccesslevel", ""
ins_LeagueGolfers.addColumn "LeagueName", "STRING_TYPE", "POST", "txtleaguename", ""
ins_LeagueGolfers.addColumn "UserName", "STRING_TYPE", "POST", "txtUsername", ""
ins_LeagueGolfers.addColumn "Password", "STRING_TYPE", "POST", "txtPassword", ""
ins_LeagueGolfers.addColumn "LastName", "STRING_TYPE", "POST", "LastName", ""
ins_LeagueGolfers.addColumn "LeagueID", "STRING_TYPE", "GET", "League", ""
ins_LeagueGolfers.addColumn "Gender", "STRING_TYPE", "POST", "Gender", ""
ins_LeagueGolfers.addColumn "Title", "STRING_TYPE", "POST", "Title", ""
ins_LeagueGolfers.addColumn "City", "STRING_TYPE", "POST", "txtCity", ""
ins_LeagueGolfers.addColumn "State", "STRING_TYPE", "POST", "State", ""
ins_LeagueGolfers.addColumn "ZipCode", "STRING_TYPE", "POST", "ZipCode", ""
ins_LeagueGolfers.addColumn "Email", "STRING_TYPE", "POST", "Email", ""
ins_LeagueGolfers.addColumn "HomePhone", "STRING_TYPE", "POST", "HomePhone", ""
ins_LeagueGolfers.addColumn "WorkPhone", "STRING_TYPE", "POST", "WorkPhone", ""
ins_LeagueGolfers.setPrimaryKey "LeagueID", "NUMERIC_TYPE", "", ""
%>
<br />
<%
' trying to add more stuff and declare vars
 
fullname = request.form("firstname_") + request.form("lastname_")
golfleaguename = rs1.Fields.Item("LeagueName").Value
If  request.form("txtaccesslevel") = "user"  Then 
 
is_admin = 0 
else 
is_admin = 1 
 
End If 
 
%>
<%
 
'Execute all the registered transactions
tNGs.executeTransactions
%>
<%
'Get the transaction recordset
Dim rsLeagueGolfers
Dim rsLeagueGolfers_numRows
 
Set rsLeagueGolfers = tNGs.getRecordset("LeagueGolfers")
rsLeagueGolfers_numRows = 0
%><%
'Get the transaction recordset
Dim rscustom
Dim rscustom_numRows
 
Set rscustom = tNGs.getRecordset("custom")
rscustom_numRows = 0
%>
<%
Dim rsLeagueGolfers_total
rsLeagueGolfers_total = KT_getNumberOfRows(rsLeagueGolfers)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../../includes/common/js/base.js" type="text/javascript"></script>
<script src="../../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../../includes/skins/style.js" type="text/javascript"></script>
<% Response.Write tNGs.displayValidationRules()%>
<script src="../../includes/nxt/scripts/form.js" type="text/javascript"></script>
<script src="../../includes/nxt/scripts/form.js.asp" type="text/javascript"></script>
<script type="text/javascript">
$NXT_FORM_SETTINGS = {
  duplicate_buttons: false,
  show_as_grid: false,
  merge_down_value: false
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}
</script>
<link href="../Template/style.css" rel="stylesheet" type="text/css">
<link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../../includes/common/js/base.js" type="text/javascript"></script>
<script src="../../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../../includes/skins/style.js" type="text/javascript"></script>
<% Response.Write tNGs.displayValidationRules()%>
<style type="text/css">
<!--
.Estilo1 {font-size: 14px}
-->
</style>
<link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../../includes/common/js/base.js" type="text/javascript"></script>
<script src="../../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../../includes/skins/style.js" type="text/javascript"></script>
<% Response.Write tNGs.displayValidationRules()%>
<style type="text/css">
<!--
.Estilo2 {color: #000000}
-->
</style>
</head>
 
<body>
<p>&nbsp;</p>
<div onKeyPress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_CPH1_P_PatQuickAdd_btnAdd')" id="ctl00_CPH1_P_PatQuickAdd_pnlPatLookup">
  <%
	Response.Write tNGs.getErrorMsg()
%>
  <div class="KT_tng">
    <h1 class="Estilo1 Estilo2">Add a Golfer </h1>
    <table width="780" height="48" border="0" cellpadding="0" cellspacing="0" class="KT_tngtable">
      <tr>
        <td width="871"><span class="Estilo1">In this section you can add golfers into your league. This golfers are not members of the full site , and have not access to entire functions.</span></td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <div class="KT_tngform">
      <form method="post" id="form1" action="<%= KT_escapeAttribute(KT_getFullUri()) %>">
        <% cnt1 = 0 %>
        <% 
While ((Repeat1__numRows <> 0) AND (NOT rsLeagueGolfers.EOF)) 
%>
          <% cnt1 = cnt1 + 1 %>
          <% tNGs.SetCounter cnt1 %>
          <%
' Show IF Conditional region1 
  If rsLeagueGolfers_total > 1 Then
%>
            <h2><%=NXT_getResource("Record_FH")%> <%=cnt1%></h2>
            <%
  End If
' End Conditional region1
%>
          <table width="273" cellpadding="2" cellspacing="0" class="KT_tngtable">
            <tr>
              <td class="KT_th">League Name </td>
              <td><strong><%=(rs1.Fields.Item("LeagueName").Value)%></strong></td>
            </tr>
            <tr>
              <td class="KT_th"><label for="FirstName_<%= cnt1 %>">Name:</label></td>
              <td><input type="text" name="FirstName_<%= cnt1 %>" id="FirstName_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("FirstName").Value))%>" size="10" maxlength="20" />
                  <%=(tNGs.displayFieldHint("FirstName"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "FirstName"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="LastName_<%= cnt1 %>">Last Name:</label></td>
              <td><input type="text" name="LastName_<%= cnt1 %>" id="LastName_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("LastName").Value))%>" size="10" maxlength="20" />
                  <%=(tNGs.displayFieldHint("LastName"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "LastName"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="Gender_<%= cnt1 %>">Gender:</label></td>
              <td><select name="Gender_<%= cnt1 %>" id="Gender_<%= cnt1 %>">
                  <option value="Male" <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Gender").Value)))) Then If ("Male" = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Gender").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Male</option>
                  <option value="Female" <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Gender").Value)))) Then If ("Female" = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Gender").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Female</option>
                </select>
                  <%=(tNGs.displayFieldError("LeagueGolfers", "Gender"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="Title_<%= cnt1 %>">Title:</label></td>
              <td><select name="Title_<%= cnt1 %>" id="Title_<%= cnt1 %>">
                  <option value="Dr." <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then If ("Dr." = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Mr.</option>
                  <option value="Mr." <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then If ("Mr." = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Dr.</option>
                  <option value="Mrs." <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then If ("Mrs." = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Mrs.</option>
                  <option value="Miss" <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then If ("Miss" = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Miss</option>
                  <option value="" >Ms</option>
                </select>
                  <%=(tNGs.displayFieldError("LeagueGolfers", "Title"))%> </td>
            </tr>
            <%
' Show IF Conditional show_City_on_insert_only 
  If Request.QueryString("LeagueID") = "" Then
%>
              <tr>
                <td class="KT_th"><label for="City_<%= cnt1 %>">City:</label></td>
                <td><label>
                <input type="text" name="txtCity" id="txtCity" />
                </label>
                <%=(tNGs.displayFieldError("LeagueGolfers", "City"))%> </td>
              </tr>
              <%
  End If
' End Conditional show_City_on_insert_only
%>
            <tr>
              <td class="KT_th"><label for="State_<%= cnt1 %>">State:</label></td>
              <td><font face="Tahoma">
                <select name="State_<%= cnt1 %>" class="txtbox1" id="State_<%= cnt1 %>">
                    <option>Select 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>
                  </font><%=(tNGs.displayFieldHint("State"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "State"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="ZipCode_<%= cnt1 %>">Zip Code:</label></td>
              <td><input type="text" name="ZipCode_<%= cnt1 %>" id="ZipCode_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("ZipCode").Value))%>" size="8" maxlength="5" />
                  <%=(tNGs.displayFieldHint("ZipCode"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "ZipCode"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="Email_<%= cnt1 %>">Email:</label></td>
              <td><input type="text" name="Email_<%= cnt1 %>" id="Email_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Email").Value))%>" size="15" maxlength="25" />
                  <%=(tNGs.displayFieldHint("Email"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "Email"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="HomePhone_<%= cnt1 %>">Home Phone:</label></td>
              <td><input type="text" name="HomePhone_<%= cnt1 %>" id="HomePhone_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("HomePhone").Value))%>" size="10" maxlength="15" />
                  <%=(tNGs.displayFieldHint("HomePhone"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "HomePhone"))%> </td>
            </tr>
            <tr>
              <td class="KT_th">Work Phone:</td>
              <td><input type="text" name="WorkPhone_<%= cnt1 %>" id="WorkPhone_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("WorkPhone").Value))%>" size="10" maxlength="15" />
                <%=(tNGs.displayFieldHint("WorkPhone"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "WorkPhone"))%></td>
            </tr>
            <tr>
              <td class="KT_th">Access level</td>
              <td><label>
                <select name="txtaccesslevel" id="txtaccesslevel">
                  <option value="2" selected="selected">user</option>
                  <option value="1">admin</option>
                </select>
              </label></td>
            </tr>
            <tr>
              <td class="KT_th">Username:</td>
              <td><label>
                <input type="text" name="txtUsername" id="txtUsername" />
              </label></td>
            </tr>
            <tr>
              <td class="KT_th">Password:</td>
              <td><input type="password" name="txtPassword" id="txtPassword" /></td>
            </tr>
            <tr>
              <td class="KT_th"><label for="WorkPhone_<%= cnt1 %>">Confirm Password:</label></td>
              <td><label>
                <input type="password" name="txtpassconfirm" id="txtpassconfirm" />
              </label></td>
            </tr>
          </table>
          <input type="hidden" name="kt_pk_LeagueGolfers_<%=cnt1%>" class="id_field" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("kt_pk_LeagueGolfers").Value))%>" />
          <input type="hidden" name="LeagueID_<%= cnt1 %>" id="LeagueID_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("LeagueID").Value))%>" />
          <input name="txtactive" type="hidden" id="txtactive" value="1" />
          <input name="txtfullname" type="hidden" id="txtfullname" value="<%=fullname %>" />
          <input name="txtleagueadmin" type="hidden" id="txtleagueadmin" value="<%= is_admin %>" />
          <input name="txtleaguename" type="hidden" id="txtleaguename" value="<%=golfleaguename %>" />
          <%
		  Repeat1__index=Repeat1__index+1
		  Repeat1__numRows=Repeat1__numRows-1
		  rsLeagueGolfers.MoveNext()
		Wend
		%>
        <div class="KT_bottombuttons">
          <div>
            <div align="left">
              <%
		' Show IF Conditional region1 
		  If Request.QueryString("LeagueID") = "" Then
		%>
                <input name="KT_Insert1" type="submit" id="KT_Insert1" onClick="YY_checkform('form1','txtPassword','txtpassconfirm','6','Confirmed Password does not Match');return document.MM_returnValue" value="<%=NXT_getResource("Insert_FB")%>" />
                <%
		' else Conditional region1
		  Else %>
                <input type="submit" name="KT_Update1" value="<%=NXT_getResource("Update_FB")%>" />
                <%
			  End If
			' End Conditional region1
			%>
              </div>
          </div>
        </div>
      </form>
    </div>
    <br class="clearfixplain" />
  </div>
  <p>&nbsp;</p>
</div>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>

Open in new window

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 23726257
>> I hate this code.

Welcome to my world.

>> We need to see the SQL Output, Where would he put that at in order to write the SQL to the screen?

There's a debugging option but now you're forcing me to go back, install CS3 and then download and install the toolkit to figure out how to apply it.
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23726334
I do not know why you have this here?
name="FirstName_<%= cnt1 %>"
What is the <%=cnt1 %>
What is it used for?
That could be 1/2 of your problem there.

And I doubt that it will work.
You need to remove the <%=cnt1 %> from your code.
As this looks to be something that is used on a page to presents a list of Dynamic content.
And this is NOT dynamic content.

So.
Try removing the FirstName_<%=cnt1 %> & LastName_<%=cnt1 %>
from your code and see what happens?
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23726362
I would never force you into doing something like that Jason.
Besides.
My son saw your name the other day, and told me not to make you mad!
Since your new movie is coming out, he does not want you to come through the computer and kill
His Dad ......
Jason = Friday the 13th.   :~)   Could not help but bring that one up.
0
 

Author Comment

by:RickyGtz
ID: 23731006
>> carrzkiss>>

I do not know why you have this here?
name="FirstName_<%= cnt1 %>"
What is the <%=cnt1 %>
What is it used for?
That could be 1/2 of your problem there.


I did as suggested but it will not insert first and last name without the subscript <%=cnt1 %>
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23732150
What is it there for?
<%=cnt1 %>

What does it do, what is it's purpose?
0
 

Author Comment

by:RickyGtz
ID: 23735612
auto generated code of developer toolbox....

i guess is for dinamic list,  a counter.. now, can you suggest me how do I add the las details on the page,  How do I insert the rest of the items into table, by using either asp regular code, or dreamweaver code, ( in my own code, ) I know how to do it , but it just dont work when I mix it with this developer tollbox code??.<

0
 
LVL 31

Assisted Solution

by:Wayne Barron
Wayne Barron earned 800 total points
ID: 23736187
You really need to get away from this Toolbox code, it is going to be the death of you in programming.

I can write you up some code to insert all the information into the db, but it is going to be
Straight Forward Classic ASP code.
It is NOT going to work with the Developer Toolbox coding.

The reason why the Developer Toolbox team made their code like this was to keep people using their program only.
Which is fine, but it takes away from the creativeness of doing it on your own.

Back to this issue.
If you want me to make up an INSERT code for you in my own way, say [Yes]
And I will do so. If not, then I am not going to be able to Assist.

Also.
The counter is for Dynamic page(s)
This is NOT a Dynamic page, it is a regular page.
So, the Dynamic code for counting the fields, SHOULD NOT be in this code what-so-ever.
0
 

Author Comment

by:RickyGtz
ID: 23736459
Carrzkiss, you are right, I just removed that counter. And re-planeed the form.

I will appreciate if you insetad of making a full form wiht the asp code, just tell me how to compkete this,, by the way I chaged the insert generated , to the webassist datassist function, So the goal is to insert the hidden fields as weel,, and insert playername  = firstname  + lastname

Let me know if you can help me on that, I areally apreciate your help so far
New Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<!--#include file="../../Connections/sqlConn1.asp" -->
<!--#include file="../../includes/common/KT_common.asp" -->
<!--#include file="../../includes/tNG/tNG.inc.asp" -->
 
 
<%
Dim rs1__MMColParam
rs1__MMColParam = "1"
If (Request.QueryString("League") <> "") Then
  rs1__MMColParam = Request.QueryString("League")
End If
%>
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
 
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_sqlConn1_STRING
rs1_cmd.CommandText = "SELECT * FROM dbo.League WHERE LeagueID = ?"
rs1_cmd.Prepared = true
rs1_cmd.Parameters.Append rs1_cmd.CreateParameter("param1", 5, 1, -1, rs1__MMColParam) ' adDouble
 
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
 
 
 
<%
'Make a transaction dispatcher instance
Dim tNGs: Set tNGs = new tNG_dispatcher
tNGs.Init "../../"
%>
<%
' Start trigger
Dim formValidation: Set formValidation = new tNG_FormValidation
formValidation.Init
formValidation.addField "First_Name", true, "text", "", "", "", ""
formValidation.addField "Last_Name", true, "text", "", "", "", ""
formValidation.addField "City", true, "text", "", "", "", ""
formValidation.addField "State", true, "text", "", "", "", ""
formValidation.addField "Phone", true, "text", "", "", "", ""
formValidation.addField "E_mail", true, "text", "email", "", "", ""
formValidation.addField "Username", true, "text", "", "", "", ""
formValidation.addField "Password", true, "text", "", "", "", ""
formValidation.addField "RePassword", true, "text", "", "", "", ""
tNGs.prepareValidation formValidation
' End trigger
%>
<%
Dim rs2__MMColParam
rs2__MMColParam = "1"
If (Request.QueryString("League") <> "") Then 
  rs2__MMColParam = Request.QueryString("League")
End If
%>
<%
Dim rs2
Dim rs2_cmd
Dim rs2_numRows
 
Set rs2_cmd = Server.CreateObject ("ADODB.Command")
rs2_cmd.ActiveConnection = MM_sqlConn1_STRING
rs2_cmd.CommandText = "SELECT * FROM dbo.League WHERE LeagueID = ?" 
rs2_cmd.Prepared = true
rs2_cmd.Parameters.Append rs2_cmd.CreateParameter("param1", 5, 1, -1, rs2__MMColParam) ' adDouble
 
Set rs2 = rs2_cmd.Execute
rs2_numRows = 0
%>
<%
' Make an insert transaction instance 
Dim customTransaction: Set customTransaction = new tNG_custom
customTransaction.init MM_sqlConn1_STRING
tNGs.addTransaction customTransaction
' Register triggers
customTransaction.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Custom1")
customTransaction.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)
customTransaction.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "AddGolferSuccess.asp")
' Set custom transaction SQL
customTransaction.setSQL "Insert into LeagueGolfers(GolferID,FirstName)  values(GOlferID, GolferName)"
' Add columns
customTransaction.addColumn "Title", "STRING_TYPE", "POST", "Title", ""
customTransaction.addColumn "First_Name", "STRING_TYPE", "POST", "First_Name", ""
customTransaction.addColumn "Last_Name", "STRING_TYPE", "POST", "Last_Name", ""
customTransaction.addColumn "Gender", "STRING_TYPE", "POST", "Gender", ""
customTransaction.addColumn "City", "STRING_TYPE", "POST", "City", ""
customTransaction.addColumn "State", "STRING_TYPE", "POST", "State", ""
customTransaction.addColumn "Phone", "STRING_TYPE", "POST", "Phone", ""
customTransaction.addColumn "E_mail", "STRING_TYPE", "POST", "E_mail", ""
customTransaction.addColumn "Username", "STRING_TYPE", "POST", "Username", ""
customTransaction.addColumn "Password", "STRING_TYPE", "POST", "Password", ""
customTransaction.addColumn "RePassword", "STRING_TYPE", "POST", "RePassword", ""
customTransaction.addColumn "Acces_Level", "NUMERIC_TYPE", "POST", "Acces_Level", ""
customTransaction.addColumn "LeagueAdmin", "NUMERIC_TYPE", "POST", "LeagueAdmin", ""
customTransaction.addColumn "LeagueName", "STRING_TYPE", "CURRVAL", "", ""
customTransaction.addColumn "FullName", "STRING_TYPE", "POST", "FullName", ""
customTransaction.addColumn "IsActive", "STRING_TYPE", "POST", "IsActive", ""
' End of custom transaction instance
%>
<%
'Execute all the registered transactions
tNGs.executeTransactions
%>
<%
'Get the transaction recordset
Dim rscustom
Dim rscustom_numRows
 
Set rscustom = tNGs.getRecordset("custom")
rscustom_numRows = 0
%>
<%
' WA Application Builder Insert
if ((Request.ServerVariables("Request_Method") = "POST") AND (inStr(Unescape(cStr(Request.ServerVariables("HTTP_REFERER"))),Unescape(Request.ServerVariables("SERVER_NAME")&Request.ServerVariables("SCRIPT_NAME"))) > 0))  then
 
 
 
  WA_connection = MM_sqlConn1_STRING
  WA_table = "dbo.LeagueGolfers"
  WA_sessionName = "LeagueGolfers_GolferID"
  WA_redirectURL = "AddGolferSuccess.asp"
  WA_keepQueryString = true
  WA_indexField = "GolferID"
  WA_fieldNamesStr = "FirstName|LastName|Gender|Title|City|State|Email|HomePhone|UserName|Password|PlayerName"
  WA_fieldValuesStr = "" & cStr(cStr(Request.Form("First_Name"))) & "" & "|" & "" & cStr(cStr(Request.Form("Last_Name"))) & "" & "|" & "" & cStr(cStr(Request.Form("Gender"))) & "" & "|" & "" & cStr(cStr(Request.Form("Title"))) & "" & "|" & "" & cStr(cStr(Request.Form("City"))) & "" & "|" & "" & cStr(cStr(Request.Form("State"))) & "" & "|" & "" & cStr(cStr(Request.Form("E_mail"))) & "" & "|" & "" & cStr(cStr(Request.Form("Phone"))) & "" & "|" & "" & cStr(cStr(Request.Form("Username"))) & "" & "|" & "" & cStr(cStr(Request.Form("Password"))) & ""
  
  
  
  WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''"
  WA_comparisonStr = " LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE "
  WA_fieldNames = Split(WA_fieldNamesStr,"|")
  WA_fieldValues = Split(WA_fieldValuesStr,"|")
  WA_columns = Split(WA_columnTypesStr,"|")
  WA_comparisions = Split(WA_comparisonStr, "|")
 
  insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
  set MM_editCmd = Server.CreateObject("ADODB.Command")
  MM_editCmd.ActiveConnection = WA_connection
  MM_editCmd.CommandText = "INSERT INTO " & WA_table & " (" & insertParamsObj(1) & ") VALUES (" & insertParamsObj(2) & ")"
  MM_editCmd.Execute()
  MM_editCmd.ActiveConnection.Close()
  obj = WA_AB_generateWhereClause(WA_fieldNames, WA_columns, WA_fieldValues, WA_comparisions)
  sqlstr = "SELECT " & WA_indexField & " FROM " & WA_table & " WHERE " &  obj & " ORDER BY " & WA_indexField & " DESC"
  set WA_AppBuilderRecordset = Server.CreateObject("ADODB.Recordset")
  WA_AppBuilderRecordset.ActiveConnection = WA_connection
  WA_AppBuilderRecordset.Source = sqlstr
  WA_AppBuilderRecordset.CursorType = 0
  WA_AppBuilderRecordset.CursorLocation = 2
  WA_AppBuilderRecordset.LockType = 1
  WA_AppBuilderRecordset.Open()
  if (NOT WA_AppBuilderRecordset.EOF)  then  Session(WA_sessionName) = WA_AppBuilderRecordset.Fields.Item(WA_indexField).Value
  WA_AppBuilderRecordset.Close()
  if (WA_redirectURL <> "")  then
    if (WA_keepQueryString AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then
      if (inStr(WA_redirectURL,"?") > 0)  then
        WA_redirectURL = WA_redirectURL & "&"
      else
        WA_redirectURL = WA_redirectURL & "?"
      end if
      WA_redirectURL = WA_redirectURL & Request.QueryString
    end if
    Response.Redirect(WA_redirectURL)
  end if
end if
%>
 
 
 
 
 
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../../includes/common/js/base.js" type="text/javascript"></script>
<script src="../../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../../includes/skins/style.js" type="text/javascript"></script>
<% Response.Write tNGs.displayValidationRules()%>
</head>
 
<body>
<p><strong>Add League Member</strong></p>
<p>
  <%
	Response.Write tNGs.getErrorMsg()
%>
</p>
<form method="post" id="form1" action="<%= KT_escapeAttribute(KT_getFullUri()) %>">
  <table width="338" height="347" cellpadding="2" cellspacing="0" class="KT_tngtable">
    <tr>
      <td class="KT_th">League Name:</td>
      <td><%=(rs2.Fields.Item("LeagueName").Value)%></td>
    </tr>
    <tr>
      <td class="KT_th"><label for="Title">Title:</label></td>
      <td><label>
        <select name="title" id="title">
          <option selected="selected">Mr.</option>
          <option>Dr.</option>
          <option>Ms.</option>
          <option>Mrs.</option>
        </select>
      </label>
<%=(tNGs.displayFieldHint("Title"))%> <%=(tNGs.displayFieldError("custom", "Title"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="First_Name">First Name:</label></td>
      <td><input type="text" name="First_Name" id="First_Name" value="<%=(KT_escapeAttribute(rscustom.Fields.Item("First_Name").Value))%>" size="32" />
          <%=(tNGs.displayFieldHint("First_Name"))%> <%=(tNGs.displayFieldError("custom", "First_Name"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="Last_Name">Last Name:</label></td>
      <td><input type="text" name="Last_Name" id="Last_Name" value="<%=(KT_escapeAttribute(rscustom.Fields.Item("Last_Name").Value))%>" size="32" />
          <%=(tNGs.displayFieldHint("Last_Name"))%> <%=(tNGs.displayFieldError("custom", "Last_Name"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="Gender">Gender:</label></td>
      <td><input type="text" name="Gender" id="Gender" value="<%=(KT_escapeAttribute(rscustom.Fields.Item("Gender").Value))%>" size="32" />
          <%=(tNGs.displayFieldHint("Gender"))%> <%=(tNGs.displayFieldError("custom", "Gender"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="City">City:</label></td>
      <td><input type="text" name="City" id="City" value="<%=(KT_escapeAttribute(rscustom.Fields.Item("City").Value))%>" size="32" />
          <%=(tNGs.displayFieldHint("City"))%> <%=(tNGs.displayFieldError("custom", "City"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="State">State:</label></td>
      <td><font face="Tahoma">
        <select name="state" class="txtbox1" id="state">
          <option selected="selected">Select 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>
      </font><%=(tNGs.displayFieldHint("State"))%> <%=(tNGs.displayFieldError("custom", "State"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="Phone">Phone:</label></td>
      <td><input type="text" name="Phone" id="Phone" value="<%=(KT_escapeAttribute(rscustom.Fields.Item("Phone").Value))%>" size="32" />
          <%=(tNGs.displayFieldHint("Phone"))%> <%=(tNGs.displayFieldError("custom", "Phone"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="E_mail">E-mail:</label></td>
      <td><input type="text" name="E_mail" id="E_mail" value="<%=(KT_escapeAttribute(rscustom.Fields.Item("E_mail").Value))%>" size="32" />
          <%=(tNGs.displayFieldHint("E_mail"))%> <%=(tNGs.displayFieldError("custom", "E_mail"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="Username">Username:</label></td>
      <td><input type="text" name="Username" id="Username" value="<%=(KT_escapeAttribute(rscustom.Fields.Item("Username").Value))%>" size="32" />
          <%=(tNGs.displayFieldHint("Username"))%> <%=(tNGs.displayFieldError("custom", "Username"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="Password">Password:</label></td>
      <td><input type="password" name="Password" id="Password" size="32" />
          <%=(tNGs.displayFieldHint("Password"))%> <%=(tNGs.displayFieldError("custom", "Password"))%> </td>
    </tr>
    <tr>
      <td class="KT_th"><label for="label">Re-Type Password:</label></td>
      <td><input type="password" name="RePassword2" id="label" size="32" />
          <%=(tNGs.displayFieldHint("RePassword"))%> <%=(tNGs.displayFieldError("custom", "RePassword"))%> </td>
    </tr>
    <tr>
      <td class="KT_th">Access Level</td>
      <td><label>
        <select name="Acces_Level" id="Acces_Level">
          <option value="1">Admin</option>
          <option value="2" selected="selected">User</option>
        </select>
      </label></td>
    </tr>
    <tr class="KT_buttons">
      <td colspan="2"><div align="center">
        <input type="submit" name="KT_Custom1" id="KT_Custom1" value="Insertar registro" />      
      </div></td>
    </tr>
  </table>
  <input type="hidden" name="LeagueAdmin" id="LeagueAdmin" value="0" />
  <input type="hidden" name="FullName" id="FullName" />
  <input type="hidden" name="IsActive" id="IsActive" value="1" />
</form>
<p>&nbsp;</p>
</body>
</html>
<%
rs2.Close()
Set rs2 = Nothing
%>
<%
rs1.Close()
Set rs1 = Nothing
%>

Open in new window

0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23751774
is this one still an issue?
Or do you have it solved already?
As I saw where you had up another post about the same thing almost
Except spacing of names.

let me know, if it is resolved, then this one needs to be closed out.
0
 

Author Comment

by:RickyGtz
ID: 23751818
yes, I am trying to get rid of dreamwevaer code still, but this form is done
thanks
0
 

Author Closing Comment

by:RickyGtz
ID: 31550737
thank you
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question