简体   繁体   English

ajax:使用第三个值通过ajax填充2个下拉框

[英]ajax :populating 2 drop down boxes via ajax using value of the third one

i hava a html page with 3 drop down boxes. 我有3个下拉框的html页面。 When i change one of the box the value in that box is sent to server and the server shold returns the values of the other 2. How will i populate the othere 2 drop down boxes depending on the value of first one. 当我更改其中一个框的值时,该框中的值将发送到服务器,服务器机架将返回另一个框的值。我将如何填充其他2个下拉框,具体取决于第一个框的值。 All valuses are obtained frm server side. 所有评估都是从服务器端获得的。

EX dd1 , dd2, dd3 where dd= drop down box EX dd1,dd2,dd3,其中dd =下拉框

if dd1 is changes the value in dd1 is sent to server and server shold return the value of other 2.How can i pouplate dd2 and dd3? 如果dd1更改,则dd1中的值将发送到服务器,服务器shold返回其他2的值。我该如何对dd2和dd3进行小化? In what form server shold reply 服务器机架以什么形式回复

Plz note:I am using plain ajax and i am not nor i want to use jquery and other frameworks. 请注意:我正在使用纯Ajax,但我不是,也不想使用jquery和其他框架。 I am looking for a solution in trival ajax. 我正在寻找简单的ajax解决方案。

Make your AJAX request and then if the response is successful, take the response data and insert into the correct position in the DOM. 发出您的AJAX请求,然后如果响应成功,则获取响应数据并将其插入DOM中的正确位置。 How straightforward it will be to insert the response will depend on the response type and format. 插入响应的简单程度将取决于响应的类型和格式。

That's the general process in using AJAX 那是使用AJAX的一般过程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM