The tutorial of helping customer House (www.bkjia.com) uses JS to operate an XML document to implement a simple form interaction.
Aspx page:
Reference content is as follows: Aspx page: <Table cellspacing = "0" cellpadding = "0" width = "100%" border = "0"> <Tr> <Td height = "25" width = "30%" align = "right"> UName: </Td> <Td height = "25" width = "*" align = "left"> <Asp: TextBox ID = "txtUName" runat = "server" Width = "200px"> </asp: TextBox> </Td> </Tr> <Tr> <Td height = "25" width = "30%" align = "right"> UCountry: </Td> <Td height = "25" width = "*" align = "left"> <Asp: TextBox ID = "txtUCountry" runat = "server" Width = "200px"> </asp: TextBox> </Td> </Tr> <Tr> <Td height = "25" width = "30%" align = "right"> UProvince: </Td> <Td height = "25" width = "*" align = "left"> <Asp: DropDownList ID = "ddlUProvince" runat = "server" onchange = "ResetCity (this, 'ddlucity');"> </Asp: DropDownList> </Td> </Tr> <Tr> <Td height = "25" width = "30%" align = "right"> UCity: </Td> <Td height = "25" width = "*" align = "left"> <Asp: DropDownList ID = "ddlUCity" runat = "server"> </Asp: DropDownList> </Td> </Tr> <Tr> <Td height = "25" colspan = "2"> <Div align = "center"> <Asp: Button ID = "btnAdd" runat = "server" Text = "register" OnClick = "btnAdd_Click"> </asp: Button> </Div> </Td> </Tr> </Table> <Script> InitProvince ('ddluprovince '); </script> |
Aspx. cs:
Reference content is as follows: String province = Request ["ddlUProvince"]; String city = Request ["ddlUCity"]; |
Download JS + XML: js1_xml_city.rar