dropdownselection的JavaScript是什么? [英] What is the javascript for dropdownselection?

查看:98
本文介绍了dropdownselection的JavaScript是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的asp.net表单中有一个下拉列表(id-ddlnoofchild)和一个单选按钮列表.
我想要一个javaScript函数,如果用户从下拉列表中选择任何项,它将使单选按钮列表成为必需.

Hi Guys,

I have one dropdown (id - ddlnoofchild) and one radio button list in my asp.net form.
I want a javaScript function, which will make the radio button list mandatory if user selects any item from the dropdown.

What is the script for that ?

推荐答案


您可以触发javascript的"onchange"事件.这里是示例.
使用JavaScript处理下拉列表选择 [ ^ ]
http://stackoverflow.com/问题/6315437/从下拉菜单更改显示功能到html标签通过ja
http://forums.asp.net/t/1109874.aspx/1 [ ^ ]

祝一切顺利.
--Amit
Hi,
You can fire "onchange" event of javascript. Here you go with the examples.
Using JavaScript to handle drop-down list selections[^]
http://stackoverflow.com/questions/6315437/display-selected-item-from-dropdown-onchange-function-into-html-label-through-ja
http://forums.asp.net/t/1109874.aspx/1[^]

All the best.
--Amit


<script type="text/javascript" >
        function myFunc()
        {

         var selectedDdl =


("option:selected","#ddlnoofchild").text(); 如果(selectedDdl =="ddltext") {
("option:selected", "#ddlnoofchild").text(); if (selectedDdl == "ddltext") {


这篇关于dropdownselection的JavaScript是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆