【发布时间】:2014-12-02 09:08:57
【问题描述】:
我正在工作一个页面,如下所示
<div id="first_div">
<form name='invoice_edit' id='invoice_edit' action='forms_invoice.php' method='post'>
<table border="0">
<tr>
<td id=customers_title_td >Customer</td>
<td id=customers_td > <!-- php code for customer list //-->
</td>
</tr>
</table>
<input type="submit" value="get" />
</form>
</div>
<div id="second_div">
<form name='customers_edit' id='customers_edit' action='forms_customer.php' method='post'>
<table>
<tr>
<td >Name</td>
<td ><input name="customers_name" type="text" value="" id="customers_name"></td>
</tr>
<tr>
<td >Bill To</td>
<td ><input name="customers_billto_addr" type="text" value="" id="customers_billto_addr"></td>
</table>
<input type="button" onClick="goCustomerUpdate('I');" value=" Create " name="Insert" />
</form>
</div>
左侧 Div(first_div) 包含发票数据,右侧 Div(second_div) 用于显示附加信息或更新,例如显示客户信息,或者如果它是新客户,则创建新客户数据。
我想要做的是在提交新客户信息时,我希望左侧 div 在提交右侧客户表单时保持不变,并在完成创建客户日志后,更新左侧 div 中的客户列表(下拉) (发票)
我不知道的部分是“我是提交到页面(forms_customer.php)还是有办法将所有元素包装在 second_div 中并使用 jquery 发送它们,也许使用 post 方法?
【问题讨论】:
-
提供更多代码。如果你没有更多的代码。开始阅读 javascript 或 php。您的问题是动态更新内容,因此您可以使用 javascript 和 ajax(用于更新客户端的内容)或 php(用于服务器端)
标签: javascript php jquery html css