Hi,
I need to modify an older project that used the web controls and attaches the date/timepicker with a script to a wwTextBox control. This all works exactly as expected.
My nuance is that this stops working if my control is housed inside a wwWebPanel control. I need to do this so that I can "hide" the entire panel including the time entry text box using the code behind approach.
I am pretty certain that this
<script type="text/javascript">
$("#tb1").timeKeys();
$("#tb0").timekeys();
$("#dpstart")
.dateKeys()
.datepicker(
{ showOn: 'button',
buttonImageOnly: true,
buttonImage: 'css/images/calendar.png',
showButtonPanel: true
});
</script>
Is where my error is. tb1 will work, whereas tb0 will not. The controls are identical, but tb0 is inside a lookup panel.
So my question (i think) is really "how should I make the script "find" my control?
The control IDs inside of a panel change due to the nesting. Take a look at the actual control IDs generated in the HTML (or with Browser Tools/Inspect). The name will be something like ctrl00_tb1
instead of tb1
. You need to use the proper name or you can use the $$()
function instead which tries to find the control in the tree regardless of the prefix albeit at a slight perf hit.
$$("tb1").timeKeys();
+++ Rick ---