Results 1 to 6 of 6

Thread: Format Question I Think...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263

    Format Question I Think...

    Ok. When I have a form that I submit. The date has to be in a certain format. For example, the date, 06/18/2001, needs to be submitted like this: 20010618. How can I format the date that is entered to be that?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Safest way is to parse it yourself. FormatDateTime() only accepts named formats.

    You could do something like:

    Code:
    var dteDate = new Date(2000, 06, 18);
    var intMonth = dteMyDate.getMonth();
    var intDay = dteMyDate.getDate();
    var intYear = dteMyDate.getYear();
    var strDate = new String(intYear.toString()+intMonth.toString()+intDay.toString());
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    That would work just fine but the user actually is to enter the date. What this is for is a search for check images. They have to enter the date of the check into the system. Is there a way to do that but use what the user entered in the text box?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  4. #4
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    replace(yourDate,"/","")

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    Where do I put that in my code? This is what I have now:
    Code:
    <%@ LANGUAGE="VBSCRIPT" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <!--Web Application Created By David Gottlieb-->
    <head>
    <title>Compass Bank - Customer Statement View</title>
    <link REL="STYLESHEET" TYPE="text/css" HREF="style2.css">
    <script LANGUAGE="JavaScript">
    <!--
    function movepic(img_name,img_src) {
     document[img_name].src=img_src;
     }
     
    //-->
    </script>
    <SCRIPT LANGUAGE=vbscript>
    <!--
    Sub TransactionSearch_OnSubmit()
    	TransactionSearch.TopicItemNamePrefix.value = TransactionSearch.Account1.value + TransactionSearch.Date1.value + TransactionSearch.Serial.value
    End Sub
    -->
    </SCRIPT>
    
    </head>
    <body background="images/right.gif">
    <table WIDTH="100%">
    <tr>
    <td ALIGN="center">
    <!--#INCLUDE FILE="toolbar.asp"-->
    </td>
    </tr>
    </table>
    <!--End of toolbar-->
    <table WIDTH="100%" align="center">
        <tr>
           <td VALIGN="center" WIDTH="100%" ALIGN="right"><a HREF="http://www.compassweb.com"><img height="60" alt="Compass Bank" hspace="20" src="../Images/compasslogotrans.gif" width="250" border="0"></a>
           </td>
        </tr>
        <tr>
           <td COLSPAN="2" ALIGN="middle"><img height="108" alt="Your Statement" src="images/compassview.gif" width="432"></a></td>
        </tr>
        
    </table>
    <table width="100%">
        <tr>
           <td colspan="2" align="right"><hr SIZE="3" NOSHADE width="50%"></td>
        </tr>
        <tr>
           <td COLSPAN="5" ALIGN="middle"><img alt="Transaction Search" src="images/search3.gif" WIDTH="324" HEIGHT="72"></td>
        </tr>
        <tr>
           <td COLSPAN="2" align="right"><hr SIZE="3" NOSHADE width="50%"></td>
        </tr>
    </table>
    <table WIDTH="100%">
    
        <tr>
           <td NOWRAP><b>Statement For:</b> 1234567
               <blockquote>James C. Grotting<br>
                           or Ann D Grotting<br>
                           2610 Caldwell Mill Ln<br>
                           Birmingham, AL  35243-1714</td></blockquote>
    					       </tr>
    </table>
    
    <table WIDTH="50%" CELLSPACING="10" CELLPADDING="8" BGCOLOR="#CAC6C6" ALIGN="center">
    <form NAME="TransactionSearch" TARGET=_blank METHOD="post" ACTION="http://compassview.compassbnk.com/ddrint/bin/ebppisap.dll">
    <INPUT TYPE="hidden" ID="TopicItemNamePrefix" NAME="TopicItemNamePrefix">
    <%
    '	Dim myVar, Account, Date1, Amount
    '	Request.Form("Account1") & Request.Form("Date1") & Request.Form("Amount")
    	
    %>
    	<tr>
    		<td STYLE="font-size: 14pt;" COLSPAN="2" ALIGN="center">Search By Transaction Type and Date</td>
    	</tr>
    	<tr>
    		<td>Search for transactions within a specific time period. Select the transaction type and enter the From and To dates in which you think the transaction posted. <i>i.e. From: 01/05/2001</i></td>
    	</tr>
    	<tr>
    		<td NOWRAP STYLE="font-weight: bold; font-size: 12pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Account: <select NAME="Account1"><option VALUE="Selected" SELECTED>----------Select Account-----------
    																																									 <option VALUE="0071052508">71052508 - Checking
    							 																																		 <option>1234567 - OD Protection
    							 																																		 <option>2345678 - Statement Savings
    							 																																		 <option>3456789 - Installment Loan
    							 																																		 <option>4567890 - Line of Credit
    							 																																		 <option>00-123-4567-5 - Real Estate Loan
    																																									 <option>00-652-9148-9 - Real Estate Loan
    																															</select>
    																																
    
    	    </td>
    	</tr>
    	<tr>
    		<td NOWRAP STYLE="font-weight: bold; font-size: 12pt;">Transaction Type: <select ID=TopicID NAME=TopicID ><option VALUE="Transaction" SELECTED>---Transaction Type---
    																											<option VALUE="CB_ACCTDAT">Check
    																											<option>Withdrawal
    																											<option>Debit
    																											<option>Deposit
    																											<option>Funds Transfer
    																											<option>All Transactions
    																				</select>
    		</td>
    	</tr>
    	<tr>
    		<td NOWRAP STYLE="font-weight: bold; font-size: 12pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;From: <input TYPE="text" NAME="Date1" SIZE="12" MAXLENGTH="12">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To: <input TYPE="text" NAME="ToDate" SIZE="12" MAXLENGTH="12"></td>
    	</tr>
    	<INPUT NAME="userid" TYPE="hidden" SIZE=10  STYLE="HEIGHT: 22px; WIDTH: 100px" WIDTH="100"><BR>
    	<INPUT TYPE="hidden" NAME="password" SIZE=10 STYLE="WIDTH: 100px" WIDTH="100"><BR>
    	<INPUT TYPE="hidden" NAME="TEMPLATE" VALUE="testall.html">
    	<INPUT TYPE="hidden" NAME="Date2" VALUE="2001061800">
    	<INPUT TYPE="hidden" NAME="Amount1" VALUE="00503895">
    	<tr>
    		<td NOWRAP COLSPAN="3" STYLE="font-weight: bold; font-size: 12pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amount: <input TYPE="text" NAME="Amount" VALUE SIZE="10"> &nbsp;&nbsp;&nbsp;Serial Number: <input TYPE="text" NAME="Serial" SIZE="10"></td>
    	</tr>
    	</tr>
    	<tr>
    		<td COLSPAN="3" STYLE="font-size: 10pt;">&nbsp;&nbsp;<input TYPE="submit" VALUE="Begin Transaction Search" NAME="Submit">&nbsp;&nbsp;&nbsp; <input TYPE="reset" VALUE="Reset Search Form"></td>
    	</tr> 
    	</FORM>
    </table>
    <!--#INCLUDE FILE="footer.asp"-->
    
    </body>
    </html>
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  6. #6
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    just leave as is(12/23/01),

    and once you submit the form,
    in your asp page do something like:

    theDate=replace(request("yourDate"),"/","")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width