即使单击按钮,如何调用文本框更改? [英] How do I call textbox change even when button is clicked?
问题描述
我有一个gridview,其中有一个带有日历按钮和文本框的列,当点击按钮时,日历控件的弹出窗口显示和当用户选择日期时,文本框中填充了日期,我现在有一个更改请求,以便当用户选择日期时,其余列的其余文本框必须具有相同的值。
我尝试过使用文字更改,但在我按下按键编辑文本框之前它不会启动。
这是我的代码:
点击按钮时:
btnPOPDropEnd.OnClientClick =popCalendar('+ txtDropEnd.ClientID + ','+ pnlPOPDropEnd.ClientID +','+ dateTestEnd +');返回false;;
设置值时:
updateCalendar(text_box,pop_div,currentDate);
当这个按钮指定d时,如何将其余的文本框值设置为相同的日期吃了一个文本框?
谢谢
Hi,
I have a gridview that has a column with a calender button and a textbox, when the button is clicked the popup for the calender control shows and when the user selects a date the textbox is populated with the date, I now have a change request so that when a user selects a date then the rest of the textboxes for the rest of the columns must get the same value.
I have tried using on text change but it does not fire until I go edit the textbox by pressing keys.
here is my code:
when the button is clicked:
btnPOPDropEnd.OnClientClick = "popCalendar('" + txtDropEnd.ClientID + "', '" + pnlPOPDropEnd.ClientID + "', '" + dateTestEnd + "'); return false;";
when setting the value:
updateCalendar(text_box, pop_div, currentDate);
how can i set the rest of the textbox values to the same date when this button assigns the date to 1 of the textboxes?
thanks
推荐答案
尝试使用jQuery触发器方法来解雇另一个控制事件..
http://api.jquery.com/trigger / [ ^ ]
Try to use jQuery trigger method to fire another control event..
http://api.jquery.com/trigger/[^]
( 按钮)。click( function (){
( "button" ).click(function() {
( textbox)。strigger( change / onchange event);
});
( "textbox" ).trigger( "change/onchange event" ); });
这篇关于即使单击按钮,如何调用文本框更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!