Click here to Skip to main content
15,887,358 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 21-Oct-15 4:41am
v2

1 solution

Try to use jQuery trigger method to fire another control event..

http://api.jquery.com/trigger/[^]

JavaScript
$( "button" ).click(function() {
  $( "textbox" ).trigger( "change/onchange event" );
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900