figure_ed_screen_sajax.php

来自「Ajax最流行书籍」· PHP 代码 · 共 86 行

PHP
86
字号
<?php// START: sajax_initrequire_once("sajax/php/Sajax.php");require_once("zipService.sajax.php");sajax_init();//$sajax_debug_mode = 1;sajax_export("get_city_state");sajax_handle_client_request();// END: sajax_init?><html>    <head>        <title>Customer Data Screen</title>	<script><!-- START: sajax_show_javascript -->	<?php sajax_show_javascript(); ?><!-- END: sajax_show_javascript --><!-- START: getZipData -->	function getZipData(zipCode) { 	  x_get_city_state(zipCode, assignCityAndState);	}<!-- END: getZipData --><!-- START: assignCityAndState -->	function assignCityAndState(data) {	  if (data.indexOf(',') > 0) {	    var cityState = data.substring(1).split(',');	    document.getElementById("city").value = cityState[0];	    document.getElementById("state").value = cityState[1];	    document.getElementById("zipError").innerHTML = "";	  } else {	    document.getElementById("zipError").innerHTML = "Error: " + data;	  }	}<!-- END: assignCityAndState -->	</script>        <style type="text/css">            th { text-align: left; }        </style>    </head>    <body>        <h1>Corporate CRM System</h1>        <h2>Enter Customer Data</h2>        <table>            <tr>                <th>Customer Name:</th>                <td><input type="text" name="name"/></td>            </tr>            <tr>                <th>Address:</th>                <td><input type="text" name="address"/></td>            </tr>            <tr>                <th>Zip:</th>                <td><input onblur="getZipData(this.value)" type="text" name="zip" size="10" maxlength="10"/></td>                <td id="zipError" style="color: red"></td>            </tr>            <tr>                <th>City:</th>                <td><input id="city" type="text" name="city" autocomplete="off" /></td>            </tr>            <tr>                <th>State:</th>                <td><input id="state" type="text" name="state" size="3" maxlength="2" autocomplete="off" /></td>            </tr>            <tr>                <th></th>                <td><input type="Submit" value="Add Customer"/></td>            </tr>        </table>    </body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?