<%--
   asp code Generated by Basic Processor
   Original Page Name: C:\gmTestBed\FMStocks\src\FMSWeb\ASP\BuyStock.asp
--%>

<%@ Page language="VB" explicit="true" CodeBehind="BuyStock.aspx.vb" Inherits="FMSWeb._BuyStock" %>

<%
   HttpContext.Current.Response.Buffer = True
%>


<html>
<head>
<% _t_head1.Author_Markup() %>

	<title>Buy</title>
<%
   'Set default prompt for users coming to the page for the first time.
   MainPrompt = FMSWeb._strings.BUYSTOCK_DEFAULT_PROMPT
   ProcessPage()
%>
	<script language="javascript">
	<!--
	function OnBuyStockClicked() {
		var f = document.frmBuy
		if (f.Ticker.value == "")
			alert("Please provide a stock symbol.");
		else if(f.Shares.value.search(/\D/) >= 0 || Number(f.Shares.value) < 1)
			alert("Invalid number of shares.");
		else
		{
			f.BuyStock.value = "Yes";
			f.submit();
		}
	}
	//-->
	</script>
</head>
<body>
<% _t_begin1.Author_Markup() %>

	<p class="section">Buy a stock</p><%=MainPrompt%><br>
	<form action="BuyStock.aspx" name="frmBuy" method="post">
	<input type="hidden" name="BuyStock" id="BuyStock" value="1">
	<table cellpadding="0" cellspacing="0" width="80%">
	<tr>
		<td>Ticker
		<td><input id="Ticker" name="Ticker" maxlength="10" size="10" value="<%=Ticker%>">
	<tr>
		<td>Shares
		<td><input id="Shares" name="Shares" maxlength="10" size="10" value="<%=Shares%>">
	<tr>
		<td>
		<td><br>
			<input onclick="OnBuyStockClicked()" type="button" value="Purchase" id="button1" name="button1">
			&nbsp;&nbsp
			<input onclick="frmBuy.reset()" type="button" value="Cancel" id="button1" name="button1">
	</tr>
	</table>
	</form>
	<a href="home.aspx">Back to home page</a>
<% _t_end1.Author_Markup() %>

</body>
</html>
