Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add drop-down box value and background acquisition of js+jquery in asp.net

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to add drop-down box values and background access to js+jquery in asp.net", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to add drop-down box values and background access to js+jquery in asp.net.

The copy code is as follows:

$(function () {)

$(".cg2") .change (function () {

Var id = $(this) .attr ("id")

Var value = $(this) .val ()

Var newid ='#'+ id.replace ('_ 1 column,'_ 2 column'); / / replace the first column id with the second column id

/ / alert (newid)

Var data = "t1*v1 | t2*v2 | t3*v3"; / / the data format obtained by the backend. A fixed value is used here.

Var datas = data.split ('|'); / / split into multiple groups

For (var I = 0; I < datas.length; iTunes +) {

Var D1 = datasi. Split ('*'); / / each group is divided into display values and real values

$(newid) .append ("" + D1 [0] + "")

/ / alert (D1)

}

/ / alert (id + "| |" + value)

});

})

In order to satisfy two columns, any number of rows. Background dynamic generation of drop-down boxes, but also before and after cascading requirements. Using js+jquery, not even server control + Ajax, always choose after

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report