JavaScript中的未定义值 [英] undefined values in javascript

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

问题描述

大家好,

我正在编写javascript,这是一个简单的函数,其中我从文本框中获取值n
asp.net中的下拉列表

我的代码:


Hi guys,

i was writing javascript, one simple function where i''m fetching values from the textboxes n
dropdownlist in asp.net

my code:


<asp:TextBox ID="StartDate" runat="server"></asp:TextBox>

 <asp:TextBox ID="EndDate" runat="server"></asp:TextBox>

  <asp:DropDownList ID="ddSection" Width="200px" runat="server">
                                            </asp:DropDownList>

<input id="Button1" type="button" value="Report" class="btn btn-success" onclick="hhmm()" />





function GetValues() {
                var Section = $(''#ddSection option:selected'').val();
                var StartDate = $(''#StartDate'').val();
                var EndDate = $(''#EndDate'').val();
                alert(''hi...............'' + Section + ''-'' + StartDate + ''--'' + EndDate);
            }



在这里,我对最后三个值的定义不确定,

谁能帮助我


谢谢



here i''m getting undefine for last three values,

can anyone plzzz help me


thanks

推荐答案

(''#ddSection选项:selected'').val(); var StartDate =
(''#ddSection option:selected'').val(); var StartDate =


(``#StartDate'').val(); var EndDate =
(''#StartDate'').val(); var EndDate =


(``#EndDate'').val(); alert(''hi ......''+ Section +''-''+ StartDate +''-''+ EndDate); }
(''#EndDate'').val(); alert(''hi...............'' + Section + ''-'' + StartDate + ''--'' + EndDate); }



在这里,我对最后三个值的定义不确定,

谁能帮助我


谢谢



here i''m getting undefine for last three values,

can anyone plzzz help me


thanks


这篇关于JavaScript中的未定义值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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