HTML sample: Populating fields on a web form with data from the BlackBerry Wallet

<head>
	<title>BlackBerry Wallet HTML sample</title>
</head>
<body>
<form>
<input type="hidden" id="bbwallet:cardType:shippingAddress"/>
<p>Shipping address</p>
<table cellspacing="10">
	<tr>
		<td align="right">Full name:</td>
		<td><input name="fullname" id="bbwallet:shippingAddress:fullName" value="" class="formFieldBasic" maxlength="120" type="text" ></td>
	</tr>
	<tr>
		<td align="right">Address</td>
		<td><input name="fulladdress" id="bbwallet:shippingAddress:fullAddress" value="" class="formFieldBasic" maxlength="200" type="text" ></td>
	</tr>
	<tr>
		<td align="right">City:</td>
		<td><input name="city" id="bbwallet:shippingAddress:city" value="" class="formFieldBasic" maxlength="50" type="text"></td>
	</tr>	
	<tr>
		<td align="right">State / Province / Region:</td>
		<td><input name="region" id="bbwallet:shippingAddress:region"  value="" class="formFieldBasic" maxlength="75" type="text"></td>
	</tr>
	<tr>
		<td align="right">Postal code:</td>
		<td><input name="postalcode" id="bbwallet:shippingAddress:postalCode"  value="" class="formFieldBasic" maxlength="75" type="text"></td>
	</tr>	
</table>
<br><br>
<input type="hidden" id="bbwallet:cardType:creditCard"/>
<p>Billing information</p>
<table cellspacing="10">
	<tr>
		<td align="right">Credit card type:</td>
		<td>
		<select name="card_type" onchange="setCCPicture(this.selectedIndex)" id="bbwallet:creditCard:creditCardType">
		<option value=""></option>
		<option value="mastercard">MasterCard</option>
		<option value="visa">Visa</option>
		<option value="amex">American Express</option>
		<option value="diner">Diner's Club</option>
		</select>
		</td>
	</tr>
	<tr>
		<td align="right">Card holder's name:</td>
		<td><input id="bbwallet:creditCard:creditCardFullName" name="name_on_card" value="" class="formFieldBasic" maxlength="75" type="text"></td>
	</tr>
	<tr>
		<td align="right">Credit card number:</td>
		<td><input name="card_number" id="bbwallet:creditCard:creditCardNumberFull" value="" class="formFieldBasic" maxlength="50" type="text"></td>
	</tr>
	<tr>
		<td align="right">Expiry date:</td>
		<td>
		month: <select name="expire_month" class="formFieldBasic" id="bbwallet:creditCard:expiryMonth">
			<option value=""></option>
		  <option value="01">01</option>
		  <option value="02">02</option>
		  <option value="03">03</option>
		  <option value="04">04</option>
		  <option value="05">05</option>
		  <option value="06">06</option>
		  <option value="07">07</option>
		  <option value="08">08</option>
		  <option value="09">09</option>
		  <option value="10">10</option>
		  <option value="11">11</option>
		  <option value="12">12</option>
		</select>
		year: <select name="expire_year" class="formFieldBasic" id="bbwallet:creditCard:expiryYear">
			<option value=""></option>
		  <option value="2007">2007</option>
		  <option value="2008">2008</option>
		  <option value="2009">2009</option>
		  <option value="2010">2010</option>
		  <option value="2011">2011</option>
		  <option value="2012">2012</option>
		  <option value="2013">2013</option>
		  <option value="2014">2014</option>
		  <option value="2015">2015</option>
		  <option value="2016">2016</option>
		  <option value="2017">2017</option>
		</select>
		</td>
	</tr>
</table>
<br><br>
<input value="Purchase" type="submit"><br><br><br>
</form>
</body></html>
Next topic: Glossary

Was this information helpful? Send us your comments.