【发布时间】:2010-07-15 16:09:38
【问题描述】:
我有一个用 Ajax 调用动态填充的选择框。用户在文本框中输入邮政编码,然后选择框会填充该邮政编码中的城市。我的问题是选择框开始为空但正确居中。一旦它从 Ajax 响应中动态填充,IE 就会将选择框向右扩展,并且不会根据新宽度重新定位它。 Firefox 和 Chrome 运行良好。我正在使用IE7进行测试。这是代码...
<table width="400" cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="center" colspan="2" class="greyheader">Location
Information</td>
</tr>
<tr>
<td colspan="2" align="center" class="grey"><span class="pagetitle1">> </span>Please
use only United States, Puerto Rico or Canada zip codes</td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="200" align="center"><b><u>Origin Zip Code</u></b></td>
<td width="200" align="center"><b><u>Destination Zip Code</u></b></td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="200" align="center">
<div id="czipS" class="shipperSpecific">
</div>
<div class="consigneeSpecific">
<center>
<input size="7" type="text" autocomplete="off" maxlength="7"
name="originZip" id="originZip" onkeypress="return handleEnter(this,event);"/>
</center>
</div>
</td>
<td width="200" align="center">
<div id="czipC" class="consigneeSpecific">
</div>
<div class="shipperSpecific">
<center>
<input size="7" type="text" autocomplete="off" maxlength="7"
name="destZip" id="destZip" onkeypress="return handleEnter(this,event);" />
</center>
</div>
</td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="200" align="center">
<div class="consigneeSpecific">
<select id="originCity" name="originCity" />
</div>
</td>
<td width="200" align="center">
<div class="shipperSpecific">
<select name="destCity" id="destCity" />
</div>
</td>
</tr>
</table>
【问题讨论】:
标签: javascript html css internet-explorer-7