Get the App
SLTechnology News&Howtos  ›  Development  › 

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

Shulou Source: shulou.com Published: 2022-06-03 08:12:28 10月13日 Update

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

Tags: Background drop-down code content controls learning selection no practical deeper interest dynamic practical practical easy to operate data methods more friends server Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Technology Docker Huawei Xiaomi