473,771 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dreamweaver Server Behaviors - Insert Record (form "form")

4 New Member
Hello everyone,

Does anyone know why after using the insert record function that Dreamweaver provides for ASP JavaScript page, then you CANNOT pass the value in the text field inside the form to another page??

Please help.

Vic.
May 13 '07 #1
3 2579
acoder
16,027 Recognized Expert Moderator MVP
I'm not familiar with this functionality, but if you post some code then it might help to debug your problem.
May 14 '07 #2
guessvic
4 New Member
Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="JAVASCRIPT"%>
  2. <!--#include file="Connections/VConn.asp" -->
  3. <%
  4.     // *** Edit Operations: declare variables
  5.     // set the form action variable
  6.     var MM_editAction = Request.ServerVariables("SCRIPT_NAME");
  7.     if (Request.QueryString) {
  8.         MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
  9.     }
  10.     // boolean to abort record edit
  11.     var MM_abortEdit = false;
  12.     // query string to execute
  13.     var MM_editQuery = "";
  14. %>
Expand|Select|Wrap|Line Numbers
  1. <%
  2.     // *** Redirect if username exists
  3.     var MM_flag="MM_insert";
  4.     if (String(Request(MM_flag)) != "undefined") {
  5.     var MM_dupKeyRedirect="MemberRegistrationPage.asp";
  6.     var MM_rsKeyConnection=MM_VConn_STRING;
  7.     var MM_dupKeyUsernameValue = String(Request.Form("user_name"));
  8.     var MM_dupKeySQL = "SELECT USER_NAME FROM s2565019.MEMBER WHERE USER_NAME='" + MM_dupKeyUsernameValue.replace(/'/g, "''") + "'"
  9.     var MM_adodbRecordset = "ADODB.Recordset";
  10.     var MM_rsKey = Server.CreateObject(MM_adodbRecordset);
  11.     MM_rsKey.ActiveConnection = MM_rsKeyConnection;
  12.     MM_rsKey.Source = MM_dupKeySQL;
  13.     MM_rsKey.CursorType=0;
  14.     MM_rsKey.CursorLocation=2;
  15.     MM_rsKey.LockType=3;
  16.     MM_rsKey.Open();
  17.     if (!MM_rsKey.EOF || !MM_rsKey.BOF) {
  18.         // the username was found - can not add the requested username
  19.         var MM_qsChar = "?";
  20.         if (MM_dupKeyRedirect.indexOf("?") >= 0) MM_qsChar = "&";
  21.             MM_dupKeyRedirect = MM_dupKeyRedirect + MM_qsChar + "requsername=" + MM_dupKeyUsernameValue;
  22.             Response.Redirect(MM_dupKeyRedirect);
  23.         }
  24.         MM_rsKey.Close();
  25.     }
  26. %>
  27. <%
  28.     // *** Insert Record: set variables
  29.     if (String(Request("MM_insert")) == "form") {
  30.         var MM_editConnection = MM_VConn_STRING;
  31.         var MM_editTable  = "s2565019.MEMBER";
  32.         var MM_editRedirectUrl = "MemberRegistrationPage1.asp";
  33.         var MM_fieldsStr = "user_name|value|pwd|value|u_type|value|f_name|value|l_name|value|dob|value|email|value|address|value|join_date|value|activate|value";
  34.         var MM_columnsStr = "USER_NAME|',none,''|PWD|',none,''|U_TYPE|',none,''|F_NAME|',none,''|L_NAME|',none,''|DOB|',none,NULL|EMAIL|',none,''|ADDRESS|',none,''|JOIN_DATE|',none,NULL|ACTIVATE|',none,''";
  35.         // create the MM_fields and MM_columns arrays
  36.         var MM_fields = MM_fieldsStr.split("|");
  37.         var MM_columns = MM_columnsStr.split("|");
  38.         // set the form values
  39.         for (var i=0; i+1 < MM_fields.length; i+=2) {
  40.             MM_fields[i+1] = String(Request.Form(MM_fields[i]));
  41.         }
  42.         // append the query string to the redirect URL
  43.         if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
  44.             MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&") + Request.QueryString;
  45.         }
  46.     }
  47. %>
Expand|Select|Wrap|Line Numbers
  1. <%
  2.     // *** Insert Record: construct a sql insert statement and execute it
  3.     if (String(Request("MM_insert")) != "undefined") {
  4.         // create the sql insert statement
  5.         var MM_tableValues = "", MM_dbValues = "";
  6.         for (var i=0; i+1 < MM_fields.length; i+=2) {
  7.             var formVal = MM_fields[i+1];
  8.             var MM_typesArray = MM_columns[i+1].split(",");
  9.             var delim =    (MM_typesArray[0] != "none") ? MM_typesArray[0] : "";
  10.             var altVal =   (MM_typesArray[1] != "none") ? MM_typesArray[1] : "";
  11.             var emptyVal = (MM_typesArray[2] != "none") ? MM_typesArray[2] : "";
  12.             if (formVal == "" || formVal == "undefined") {
  13.                 formVal = emptyVal;
  14.             } else {
  15.                 if (altVal != "") {
  16.                     formVal = altVal;
  17.                 } else if (delim == "'") { // escape quotes
  18.                     formVal = "'" + formVal.replace(/'/g,"''") + "'";
  19.                 } else {
  20.                     formVal = delim + formVal + delim;
  21.                 }
  22.             }
  23.             MM_tableValues += ((i != 0) ? "," : "") + MM_columns[i];
  24.             MM_dbValues += ((i != 0) ? "," : "") + formVal;
  25.         }
  26.         MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues + ") values (" + MM_dbValues + ")";
  27.         if (!MM_abortEdit) {
  28.             // execute the insert
  29.             var MM_editCmd = Server.CreateObject('ADODB.Command');
  30.             MM_editCmd.ActiveConnection = MM_editConnection;
  31.             MM_editCmd.CommandText = MM_editQuery;
  32.             MM_editCmd.Execute();
  33.             MM_editCmd.ActiveConnection.Close();
  34.             if (MM_editRedirectUrl) {
  35.                 Response.Redirect(MM_editRedirectUrl);
  36.             }
  37.         }
  38.     }
  39. %>
Expand|Select|Wrap|Line Numbers
  1. <%
  2.     var m_Rs = Server.CreateObject("ADODB.Recordset");
  3.     m_Rs.ActiveConnection = MM_VConn_STRING;
  4.     m_Rs.Source = "SELECT *  FROM s2565019.MEMBER";
  5.     m_Rs.CursorType = 0;
  6.     m_Rs.CursorLocation = 2;
  7.     m_Rs.LockType = 1;
  8.     m_Rs.Open();
  9.     var m_Rs_numRows = 0;
  10. %>
Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <script language="javascript" src="MemberRegistrationValidation.js">
  3. </script>
  4. <title>Member Registration Page</title>
  5. </head>
  6. <body onLoad="setTimeout('CurrDate(),CurrMonth(),CurrYear()',100)">
  7.     <form ACTION="<%=MM_editAction%>" METHOD="POST" name="form" onSubmit="return fieldsCheck()">
  8.         <table align="center">    
  9.             <tr>
  10.                 <th align="left"><font color="#FF0000">*</font>
  11.                     User Name
  12.                 </th>
  13.                 <td>
  14.                     <input name="user_name" type="text" title="Enter Your User Name." maxlength="16">
  15.                 </td>
  16.             </tr>
  17.             <tr>
  18.                 <th align="left"><font color="#FF0000">*</font>
  19.                     Password
  20.                 </th>
  21.                 <td>
  22.                     <input name="pwd" type="password" title="Enter 8~16 Characters" maxlength="16">
  23.                 </td>
  24.             </tr>
  25.             <tr>
  26.                 <th align="left"><font color="#FF0000">*</font>
  27.                     Re-type Password
  28.                 </th>
  29.                 <td>
  30.                     <input name="re_pwd" type="password" title="Enter 8~16 Characters" maxlength="16">
  31.                 </td>
  32.             </tr>
  33.             <tr>
  34.                 <th align="left"><font color="#FF0000">*</font>
  35.                     Select User Type
  36.                 </th>
  37.                 <td align="left">
  38.                     <input name="u_type" type="radio" checked title="Limited Functions." align="left" value="Basic">Basic User<br>
  39.                     <input name="u_type" type="radio" title="Advanced Functions." align="left" value="Advanced">Advanced User<br>
  40.                     <input name="u_type" type="radio" title="Ultimate Functions." align="left" value="Premier">Premier User
  41.                 </td>
  42.             </tr>
  43.             <tr>
  44.                 <th align="left"><font color="#FF0000">*</font>
  45.                     First Name
  46.                 </th>
  47.                 <td>
  48.                     <input name="f_name" type="text" title="Enter Your First Name." maxlength="30">
  49.                 </td>
  50.             </tr>
  51.             <tr>
  52.                 <th align="left"><font color="#FF0000">*</font>
  53.                     Last Name
  54.                 </th>
  55.                 <td>
  56.                     <input name="l_name" type="text" title="Enter Your Last Name." maxlength="15">
  57.                 </td>
  58.             </tr>
  59.             <tr>
  60.                 <th align="left"><font color="#FF0000">*</font>
  61.                     Date of Birth
  62.                 </th>
  63.                 <td>
  64.                     <input name="dob" type="hidden">
  65.                     <script language="javascript">
  66.                         document.write("Date ");
  67.  
  68.                         var dt = new Date();
  69.                         document.write("<input name=\"date\" id=\"date\" type=\"hidden\">");
  70.                         document.write("<select name=\"the_date\" id=\"the_date\">");
  71.                         for(dd = 1; dd < 32; dd++){
  72.                             document.write("<option selected value=" + dd + ">" + dd + "</option>");
  73.                         }
  74.                         document.write("</select>");
  75.                         function CurrDate(){
  76.                             var list = document.getElementById("the_date");
  77.                             list.selectedIndex = 0;
  78.                             list.onchange = function(){
  79.                                 document.getElementById("date").value = list.options[list.selectedIndex].value;
  80.                                 document.form.dob.value = document.getElementById("date").value + "/" + document.getElementById("month").value + "/" + document.getElementById("year").value;
  81.                             }
  82.                         }
  83.                         document.getElementById("date").value = 1;
  84.  
  85.                         document.write(" Month ");
  86.  
  87.                         var mnames = new Array("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC");
  88.                         var mth = new Date();
  89.                         document.write("<input name=\"month\" id=\"month\" type=\"hidden\">");
  90.                         document.write("<select name=\"the_month\" id=\"the_month\">");
  91.                         for(mm = 1; mm < 13; mm++){
  92.                             document.write("<option selected value=" + mm + ">" + mnames[mm-1] + "</option>");
  93.                         }
  94.                         document.write("</select>");
  95.                         function CurrMonth(){
  96.                             var list = document.getElementById("the_month");
  97.                             list.selectedIndex = mth.getMonth();
  98.                             list.onchange = function(){
  99.                                 document.getElementById("month").value = list.options[list.selectedIndex].text;
  100.                                 document.form.dob.value = document.getElementById("date").value + "/" + document.getElementById("month").value + "/" + document.getElementById("year").value;
  101.                             }
  102.                         }
  103.                         document.getElementById("month").value = mnames[mth.getMonth()];
  104.  
  105.                         document.write(" Year ");
  106.  
  107.                         var yyyy = new Date();
  108.                         document.write("<input name=\"year\" id=\"year\" type=\"hidden\">");
  109.                         document.write("<select name=\"the_year\" id=\"the_year\">");
  110.                         for(yy = 1950; yy < 2030; yy++){
  111.                             document.write("<option selected value=" + yy + ">" + yy + "</option>");
  112.                         }
  113.                         document.write("</select>");
  114.                         function CurrYear(){
  115.                             var list = document.getElementById("the_year");
  116.                             list.selectedIndex = 57;
  117.                             list.onchange = function(){
  118.                                 document.getElementById("year").value = list.options[list.selectedIndex].value;
  119.                                 document.form.dob.value = document.getElementById("date").value + "/" + document.getElementById("month").value + "/" + document.getElementById("year").value;
  120.                             }
  121.                         }
  122.                         document.getElementById("year").value = yyyy.getFullYear();
  123.                         document.form.dob.value = document.getElementById("date").value + "/" + document.getElementById("month").value + "/" + document.getElementById("year").value;
  124.                     </script>
  125.                 </td>
  126.             </tr>
  127.             <tr>
  128.                 <th align="left"><font color="#FF0000">*</font>
  129.                     Email
  130.                 </th>
  131.                 <td>
  132.                     <input name="email" type="text" title="Enter Your Email." maxlength="40">
  133.                 </td>
  134.             </tr>
  135.             <tr>
  136.                 <th align="left"><font color="#FF0000">*</font>
  137.                     Full Address
  138.                 </th>
  139.                 <td>
  140.                     <input name="address" type="text" title="Enter Your Full Address." maxlength="70">
  141.                 </td>
  142.             </tr>
  143.             <tr>
  144.                 <th align="left"></th>
  145.                 <td>
  146.                     <input name="join_date" type="hidden">
  147.                     <script type="text/javascript">
  148.                         var months=new Array(13);
  149.                         months[1] ="January";
  150.                         months[2] = "February";
  151.                         months[3] = "March";
  152.                         months[4] = "April";
  153.                         months[5] = "May";
  154.                         months[6] = "June";
  155.                         months[7] = "July";
  156.                         months[8] = "August";
  157.                         months[9] = "September";
  158.                         months[10]= "October";
  159.                         months[11]= "November";
  160.                         months[12]= "December";
  161.                         var time=new Date();
  162.                         var lmonth=months[time.getMonth() + 1];
  163.                         var date = time.getDate();
  164.                         var year = time.getFullYear()
  165.                         document.form.join_date.value = date + "/" + lmonth + "/" + year;
  166.                     </script>
  167.                 </td>
  168.             </tr>
  169.             <tr>
  170.                 <td>
  171.                     <input name="activate" type="hidden">
  172.                 </td>
  173.             </tr>
  174.             <tr align="left">
  175.                 <th></th>
  176.                 <td align="left">
  177.                     <input name="Submit" type="submit" value="Submit">
  178.                     <input name="Reset" type="reset" value="Reset All">
  179.                 </td>
  180.             </tr>
  181.         </table>
  182.         <input type="hidden" name="MM_insert" value="form">
  183.     </form>
  184.     <form action="MemberRegistrationPage1.asp" method="link">
  185.         <input name="uname" type="text" title="Enter Your User Name." maxlength="16">
  186.         <script language="JavaScript" type="text/javascript">
  187.             document.getElementById("user_name").onkeyup = function(){
  188.                 document.getElementById("uname").value = this.value;
  189.             }
  190.             setTimeout('document.getElementById("user_name").value = "";document.getElementById("uname").value = ""',200);
  191.         </script>
  192.     </form>
  193. </body>
Expand|Select|Wrap|Line Numbers
  1. <%
  2.     m_Rs.Close();
  3. %>
  4.  
Input name UNAME should be pass to the other web site which it doesn't.

Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="JAVASCRIPT" CODEPAGE="950"%>
  2. <!--#include file="Connections/VConn.asp" -->
  3. <%
  4.     var Rs = Server.CreateObject("ADODB.Recordset");
  5.     Rs.ActiveConnection = MM_VConn_STRING;
  6.     Rs.Source = "SELECT *  FROM s2565019.PAYMENT_DETAIL  ORDER BY PD_ID DESC";
  7.     Rs.CursorType = 0;
  8.     Rs.CursorLocation = 2;
  9.     Rs.LockType = 1;
  10.     Rs.Open();
  11.     var Rs_numRows = 0;
  12. %>
  13. <%
  14.     // *** Edit Operations: declare variables    
  15.     // set the form action variable
  16.     var MM_editAction = Request.ServerVariables("SCRIPT_NAME");
  17.     if (Request.QueryString) {
  18.           MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
  19.     }
  20.     // boolean to abort record edit
  21.     var MM_abortEdit = false;
  22.     // query string to execute
  23.     var MM_editQuery = "";
  24. %>
  25. <%
  26.     // *** Insert Record: set variables
  27.     if (String(Request("MM_insert")) == "form") {
  28.         var MM_editConnection = MM_VConn_STRING;
  29.         var MM_editTable  = "s2565019.PAYMENT_DETAIL";
  30.         var MM_editRedirectUrl = "Test.asp";
  31.         var MM_fieldsStr = "pd_id|value|card_type|value|card_no|value|card_scrt_no|value|exp_date|value|card_holder|value";
  32.         var MM_columnsStr = "pd_id|none,none,NULL|CARD_TYPE|',none,''|CARD_NO|',none,''|CARD_SCRT_NO|none,none,NULL|EXP_DATE|none,none,NULL|CARD_HOLDER|',none,''";
  33.         // create the MM_fields and MM_columns arrays
  34.         var MM_fields = MM_fieldsStr.split("|");
  35.         var MM_columns = MM_columnsStr.split("|");
  36.         // set the form values
  37.         for (var i=0; i+1 < MM_fields.length; i+=2) {
  38.             MM_fields[i+1] = String(Request.Form(MM_fields[i]));
  39.         }        
  40.         // append the query string to the redirect URL
  41.         if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
  42.             MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&") + Request.QueryString;
  43.         }
  44.     }
  45. %>
  46. <%
  47.     // *** Insert Record: construct a sql insert statement and execute it
  48.     if (String(Request("MM_insert")) != "undefined") {    
  49.         // create the sql insert statement
  50.         var MM_tableValues = "", MM_dbValues = "";
  51.         for (var i=0; i+1 < MM_fields.length; i+=2) {
  52.             var formVal = MM_fields[i+1];
  53.             var MM_typesArray = MM_columns[i+1].split(",");
  54.             var delim =    (MM_typesArray[0] != "none") ? MM_typesArray[0] : "";
  55.             var altVal =   (MM_typesArray[1] != "none") ? MM_typesArray[1] : "";
  56.             var emptyVal = (MM_typesArray[2] != "none") ? MM_typesArray[2] : "";
  57.             if (formVal == "" || formVal == "undefined") {
  58.                 formVal = emptyVal;
  59.             } else {
  60.                 if (altVal != "") {
  61.                     formVal = altVal;
  62.                 } else if (delim == "'") { // escape quotes
  63.                     formVal = "'" + formVal.replace(/'/g,"''") + "'";
  64.                 } else {
  65.                     formVal = delim + formVal + delim;
  66.                 }
  67.             }
  68.             MM_tableValues += ((i != 0) ? "," : "") + MM_columns[i];
  69.             MM_dbValues += ((i != 0) ? "," : "") + formVal;
  70.         }
  71.         MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues + ") values (" + MM_dbValues + ")";
  72.         if (!MM_abortEdit) {
  73.             // execute the insert
  74.             var MM_editCmd = Server.CreateObject('ADODB.Command');
  75.             MM_editCmd.ActiveConnection = MM_editConnection;
  76.             MM_editCmd.CommandText = MM_editQuery;
  77.             MM_editCmd.Execute();
  78.             MM_editCmd.ActiveConnection.Close();
  79.             if (MM_editRedirectUrl) {
  80.                 Response.Redirect(MM_editRedirectUrl);
  81.             }
  82.         }
  83.     }
  84. %>
  85. <html>
  86. <head>
  87. <script language="javascript" src="MemberRegistrationValidation.js">
  88. </script>
  89. <title>Member Registration Page</title>
  90. <meta http-equiv="Content-Type" content="text/html; charset=big5">
  91. </head>
  92. <body onLoad="setTimeout('selCurrMonth(),selCurrYear()',100)">
  93.     <form name="form1">
  94.         <input name="user_name" type="hidden">
  95.         <script language="javascript">
  96.             var locate = window.location
  97.             document.form1.user_name.value = locate
  98.  
  99.             var text = document.form1.user_name.value
  100.  
  101.             function delineate(str)
  102.             {
  103.                 theleft = str.indexOf("=") + 1;
  104.                 theright = str.lastIndexOf("&");
  105.                 return(str.substring(theleft, theright));
  106.             }
  107.  
  108.             function delineate2(str)
  109.             {
  110.                 point = str.lastIndexOf("=");
  111.                 return(str.substring(point+1,str.length));
  112.             }
  113.         </script>
  114.     </form>
  115.     <form onSubmit="return fieldsCheck()" action="<%=MM_editAction%>" METHOD="POST" name="form">
  116.         <table align="center">
  117.             <tr>
  118.                 <td>
  119.                     <input name="id" type="hidden" value="<%=Rs.Fields("pd_id")%>">
  120.                     <script>
  121.                         var num = parseInt(document.form.id.value);
  122.                         var sum = 1;
  123.                         sum += num;
  124.                         document.write("<input name=\"pd_id\" type=\"text\">");
  125.                         document.form.pd_id.value = sum;
  126.                     </script>
  127.                 </td>
  128.             </tr>
  129.             <tr>
  130.                 <td>
  131.                     <input name="uname" type="text">
  132.                     <script language="javascript">
  133.                         var Data = delineate2(text)
  134.                         document.form.uname.value = Data
  135.                     </script>
  136.                 </td>
  137.             </tr>
  138.             <tr>
  139.                 <th align="left"><font color="#FF0000">*</font>
  140.                     Credit Card Type
  141.                 </th>
  142.                 <td>
  143.                     <select name="card_type" style = "width:3.9cm">
  144.                         <optgroup label="Credit Card Type">
  145.                             <option selected="selected">Visa</option>
  146.                             <option>MasterCard</option>
  147.                             <option>AmericanExpress</option>
  148.                         </optgroup>
  149.                   </select>
  150.                 </td>
  151.             </tr>
  152.             <tr>
  153.                 <th align="left"><font color="#FF0000">*</font>
  154.                     Card Number
  155.                 </th>
  156.                 <td>
  157.                     <input name="card_no" type="text" maxlength="16" onKeyUp="javascript:checkNumber(form.card_no);">
  158.                 </td>
  159.             </tr>
  160.             <tr>
  161.                 <th align="left"><font color="#FF0000">*</font>
  162.                     Security Number
  163.                 </th>
  164.                 <td>
  165.                     <input name="card_scrt_no" type="password" maxlength="4" onKeyUp="javascript:checkNumber(form.card_scrt_no);">
  166.                 </td>
  167.             </tr>
  168.             <tr>
  169.                 <th align="left"><font color="#FF0000">*</font>
  170.                     Expiry Date
  171.                 </th>
  172.                 <td>
  173.                     <input name="exp_date" type="hidden">
  174.                     <span>Month </span>
  175.                     <script language="javascript">
  176.                         //var mnames = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  177.                         var mth = new Date();
  178.                         //document.write("<p>Current option text: <input name=\"curtxt\" id=\"curtxt\" size=\"10\"></p>");
  179.                         document.write("<input name=\"month\" id=\"month\" type=\"hidden\">");
  180.                         //document.write("<p>Current option selectedIndex: <input name=\"curselind\" id=\"curselind\" size=\"10\"></p>");
  181.                         document.write("<select name=\"the_month\" id=\"the_month\">");
  182.                         for(mm = 1; mm < 13; mm++){
  183.                             document.write("<option selected value=" + mm + ">" + mm + "</option>");
  184.                         }
  185.                         document.write("</select>");
  186.                         function selCurrMonth(){
  187.                             var list = document.getElementById("the_month");
  188.                             list.selectedIndex = mth.getMonth();
  189.                             list.onchange = function(){
  190.                                 //document.getElementById("curtxt").value = list.options[list.selectedIndex].text;
  191.                                 document.getElementById("month").value = list.options[list.selectedIndex].value;
  192.                                 document.form.exp_date.value = document.getElementById("month").value + "" + document.getElementById("year").value;
  193.                                 //document.getElementById("curselind").value = list.selectedIndex+1;
  194.                                 //window.alert("Selected month is " + list.options[list.selectedIndex].text + " and its option value is " + list.options[list.selectedIndex].value);
  195.                             }
  196.                         }
  197.                         document.getElementById("month").value = mth.getMonth()+1;
  198.  
  199.                         document.write(" Year ");
  200.  
  201.                         var yyyy = new Date();
  202.                         document.write("<input name=\"year\" id=\"year\" type=\"hidden\">");
  203.                         document.write("<select name=\"the_year\" id=\"the_year\">");
  204.                         for(yy = yyyy.getFullYear(); yy < 2029; yy++){
  205.                             document.write("<option selected value=" + yy + ">" + yy + "</option>");
  206.                         }
  207.                         document.write("</select>");
  208.                         function selCurrYear(){
  209.                             var list = document.getElementById("the_year");
  210.                             list.selectedIndex = 0;
  211.                             list.onchange = function(){
  212.                                 document.getElementById("year").value = list.options[list.selectedIndex].value;
  213.                                 document.form.exp_date.value = document.getElementById("month").value + "" + document.getElementById("year").value;
  214.                             }
  215.                         }
  216.                         document.getElementById("year").value = yyyy.getFullYear();
  217.                         document.form.exp_date.value = document.getElementById("month").value + "" + document.getElementById("year").value;
  218.                     </script>
  219.                 </td>
  220.             </tr>
  221.             <tr>
  222.                 <th align="left"><font color="#FF0000">*</font>
  223.                     Card Holder
  224.                 </th>
  225.                 <td>
  226.                     <input name="card_holder" type="text" maxlength="50">
  227.                 </td>
  228.             </tr>
  229.             <tr align="left">
  230.                 <th></th>
  231.                 <td align="left">
  232.                     <input name="Submit" type="submit" value="Submit">
  233.                     <input name="Reset" type="reset" value="Reset All">
  234.                 </td>
  235.             </tr>
  236.         </table>
  237.         <input type="hidden" name="MM_insert" value="form">
  238.     </form>
  239. </body>
  240. </html>
  241. <%
  242.     Rs.Close();
  243. %>
May 14 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Phew, that was a lot of work putting your code in tags.

I can't be bothered going through all that. Can you pinpoint where you think the error is and just post that instead.
May 15 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2879
by: Don | last post by:
I have a need to simulate the submission of an html-like <form> on the server, and was wondering if anyone knew of something out there that could do that. Thanks for your help, Don
2
17768
by: John Davis | last post by:
I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the same, which is to return the value of the field?? Thanks, John
3
2706
by: Pavils Jurjans | last post by:
Hello, I have bumped upon this problem: I do some client-side form processing with JavaScript, and for this I loop over all the forms in the document. In order to identify them, I read their "name" property (which sources from "name" HTML attribue). The problem is, that if the form contains form control named "name", it overwrites the form name property. In fact, I'm quite surprised that it's so easy to spoil any of the form object...
11
4177
by: Pete Wilson | last post by:
Hi folks -- The page at http://www.pwilson.net/submit-demo.html will not validate. The validator at http://validator.w3.org tells me I can't have an input inside a form. Would some kind soul please tell me what I'm doing wrong?
9
21495
by: Dan | last post by:
I am trying to use Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "". I am not really sure why, this happens for all of my controls that invoke are invoking a post back. I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the...
2
1900
by: Parasyke | last post by:
Please help.... I have a form that I successfully add records to that I want to copy and turn into a form for editing records from that same table (It is imperitive that it be done this way, rather than just one form) ... I need in the textbox for the new edit form to have the user type in a item# then the form populates. I'm having tremedous trouble with the logic of this. Thanks!!! Dav
0
1957
by: bolinc | last post by:
Can someone tell me why this isn't working? <Script language="JavaScript"><!--// var bJavaEnabled = Boolean(clientInformation.javaEnabled()); if (bJavaEnabled){ document.write('<form method="post" name="hiddenform" id="hiddenform" action="Specials.asp">'); document.write('<input type="hidden" id="enabled" name="enabled" value="1">'); document.write('</form>'); } //-->
6
2433
by: KiwiGenie | last post by:
Hi..I am trying to make a search form. I am fairly new to access and could well be looking at it completely wrong. I have an unbound form with textboxes in the header for entering different search criteria. I have a subform for displaying the results, which is bound to Query4. SQL for Query4 (taken from sql view in query): SELECT tblRecipes.RecipeName, tblRecipes.FoodCategory, Sum(Query3.IngredCost) AS SumOfIngredCost, Query3.RecipeID FROM...
2
2522
by: guessvic | last post by:
Hello everyone, Does anyone know why after using the insert record function that Dreamweaver provides for ASP JavaScript page, then you CANNOT pass the value in the text field inside the form to another page?? Please help. Vic.
3
1917
by: eBob.com | last post by:
How does a "sub-form", i.e. one invoked by another form, determine anything about the form which brought it into existence, i.e., I suppose, instantiated it? I wanted to so something like this ... MsgBox("called by " & Owner.Name) .... but that throws a null reference exception. Parent.Name and ParentForm.Name also throw null reference exceptions. Form1.Name works - but that's not very flexible.
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.