我正在尝试为我的网站创建一个存款只读参考字段,并将其作为发票号传递给贝宝。用于识别。参考编号 由函数日期填充,格式为 DD/MM/YY、名字和姓氏的第一个字符。(例如 05/07/13scottp)
我希望对所有可编辑字段进行必填字段验证,并在用户输入函数日期后填充存款参考....
我是 PHP 新手,不确定从哪里开始或实现我想要的结果的最佳实践。
我正在使用带有以下代码的 HTML 表单:
<form id="depositForm" name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<div id="deposit-form" >
<h1>Paying your deposit is Simple.....</h1>
<p>Simply input all the details below, select your advised deposit option and click "Buy Now". It's that easy......</p>
<p>Note: All fields marked <h7>*</h7> are required. Any Errors will be highlighted <h7>Red</h7>.
<table>
<tr>
<td>
<label for="depositFirstname">*Firstname:</label>
<label for="depositSurname">*Surname:</label>
<label for="depositFunctiondate">*Function Date:</label>
<label for="depositOp">*Select deposit option:</label>
<label for="depositRef">Booking Reference:</label>
</td>
</tr>
<tr>
<td>
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="XXXXXX">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="country" value="United Kingdom" />
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="item_name" value="Glimmer Nights Function Deposit">
<input type="text" name="first_name" id="depositFirstname" />
<input type="text" name="last_name" id="depositSurname" />
<input type="text" name="depositFunctiondate" id="depositFunctiondate" />
<select size="1" name="amount" id="depositOp" class="input" />
<option value="">Select</option>
<option name="amount" value="30.00">Option 1</option>
<option name="amount" value="50.00">Option 2</option>
<input type="text" name="invoice" id="depositRef" readonly="depositRef()" value="" />
</td>
</tr>
</table>
<p>Should you have any questions, please do not hesitate to contact us........</p>
<input type="image" src="http://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</div>
</form>