Click here to Skip to main content
15,891,423 members
Home / Discussions / Web Development
   

Web Development

 
GeneralJavascript Simulating a KeyPress Pin
gmhanna19-Aug-04 7:16
gmhanna19-Aug-04 7:16 
GeneralRe: WebForm Design Problem / Help? Pin
gmhanna19-Aug-04 4:38
gmhanna19-Aug-04 4:38 
GeneralNewbie JavaScript Questions Pin
gmhanna19-Aug-04 4:13
gmhanna19-Aug-04 4:13 
GeneralRe: Newbie JavaScript Questions Pin
Paul Watson20-Aug-04 10:52
sitebuilderPaul Watson20-Aug-04 10:52 
GeneralEditing websites html pages Pin
Amitux19-Aug-04 0:23
Amitux19-Aug-04 0:23 
GeneralRunning application in browser frame Pin
wegerjos18-Aug-04 22:10
wegerjos18-Aug-04 22:10 
GeneralRe: Running application in browser frame Pin
Paul Watson20-Aug-04 10:53
sitebuilderPaul Watson20-Aug-04 10:53 
GeneralNewbie JavaScript Help Pin
gmhanna18-Aug-04 15:08
gmhanna18-Aug-04 15:08 
Hi,

I am trying to write a script that will take an input field value from a ASP.NET form and determine if its magnetic data from a magstrip on a credit card. The application is written in C# and uses Server Validation controls to validate the data. The controls need to run server side because when the SUBMIT button is pushed the server needs to validate the data.

I do not want to send the data when the Credit Card Number field looses focus to the server, it is disruptive to the user but I need to determine if the card was swipped and if so pull off the Card Number, Card Holder's Name and the Expiration Date and populate the fields.

Since I'm new to JavaScript, I figured I would write something simple and hook it to my code for OnTextChange. The problem is I'm receiving the following error: Compiler Error Message: CS0117: 'ASP.WebForm1_aspx' does not contain a definition for 'isScanned'

I put my JavaScript in the head section as follows:

<HEAD><br />
		<title>Merchant Charge Plus / 2004 Web - Authorization Screen</title><br />
		<meta content="False" name="vs_snapToGrid"><br />
		<meta content="True" name="vs_showGrid"><br />
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"><br />
		<meta content="C#" name="CODE_LANGUAGE"><br />
		<meta content="JavaScript" name="vs_defaultClientScript"><br />
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"><br />
		<br />
	<script language="javascript"><br />
		function isScanned( )<br />
		{<br />
			var index = 0;<br />
			CardNo = document.Form1.efCardNo.value;<br />
		<br />
			if (CardNo.subString(0, 2) == "%b" || CardNo.subString(0, 2) == "%B" <br />
			||  CardNo.subString(0, 2) == "%a" || CardNo.subString(0, 2) == "%A")<br />
			{<br />
			    window.alert("Card was scanned");<br />
			}<br />
			<br />
			return;<br />
		}<br />
	</script><br />
	</HEAD>


and the call for the routine is:
<br />
asp:TextBox id="efCardNo" style="Z-INDEX: 112; LEFT: 152px; POSITION: absolute; TOP: 67px" tabIndex="3" OnTextChanged="isScanned" runat="server" ToolTip="Enter the Card Holder's name as it appears on the card" Width="193"<br />


I don't see what I did wrong, I see the function. Is it because of the runat="server" and it thinks the function is on the server? If so, how do I have a client side routine and a server side?

Thanks for your help,

Glenn
GeneralRe: Newbie JavaScript Help Pin
ChrisAdams18-Aug-04 16:39
ChrisAdams18-Aug-04 16:39 
GeneralSafari Browser detection PLEASE HELP! Pin
nmotlani18-Aug-04 12:59
sussnmotlani18-Aug-04 12:59 
GeneralImage copier - the best image tool for all programmers, don't miss it (tool announcement:) Pin
includeh1017-Aug-04 11:32
includeh1017-Aug-04 11:32 
QuestionHow can I close the first page? Pin
ATC17-Aug-04 2:55
ATC17-Aug-04 2:55 
AnswerRe: How can I close the first page? Pin
ChrisAdams17-Aug-04 17:14
ChrisAdams17-Aug-04 17:14 
GeneralASP calling a DLL Problem!! Pin
Jason Jefferies16-Aug-04 23:04
Jason Jefferies16-Aug-04 23:04 
GeneralRe: ASP calling a DLL Problem!! Pin
wegerjos19-Aug-04 1:41
wegerjos19-Aug-04 1:41 
GeneralRemoving and replacing the bottom border of a table cell in Netscape Pin
Anonymous16-Aug-04 5:05
Anonymous16-Aug-04 5:05 
General&lt;TEXTAREA&gt; ELEMENT TEXT COLOR DOESN'T CHANGE Pin
Brendan Vogt16-Aug-04 4:38
Brendan Vogt16-Aug-04 4:38 
GeneralDatabase Transactions Pin
Brendan Vogt16-Aug-04 4:37
Brendan Vogt16-Aug-04 4:37 
GeneralASP: Combo load and combo reset Pin
Brendan Vogt16-Aug-04 4:35
Brendan Vogt16-Aug-04 4:35 
GeneralNetscape Constant Strings Pin
Brendan Vogt16-Aug-04 4:30
Brendan Vogt16-Aug-04 4:30 
GeneralThe RegExp Object Pin
Brendan Vogt16-Aug-04 4:29
Brendan Vogt16-Aug-04 4:29 
GeneralJavaScript - Validation Pin
Brendan Vogt16-Aug-04 4:27
Brendan Vogt16-Aug-04 4:27 
GeneralRe: JavaScript - Validation Pin
gmhanna18-Aug-04 15:35
gmhanna18-Aug-04 15:35 
GeneralCertificate Stores Pin
Gavin Jeffrey16-Aug-04 3:27
Gavin Jeffrey16-Aug-04 3:27 
GeneralAccess Web Browser Control Contents Pin
Asif Rehman14-Aug-04 17:07
Asif Rehman14-Aug-04 17:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.