473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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

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 2560
acoder
16,027 Expert Mod 8TB
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
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 Expert Mod 8TB
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
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
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?? ...
3
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...
11
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...
9
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...
2
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...
0
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...
6
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...
2
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...
3
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 ......
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.