on 07-24-2007 7:46 AM
Hi,
I have created a text field with calendar in HTML Page. if i select a date from the calendar i am getting the Date in the TextBox. i have to match that TextBox Date it to the Query Template Date. Please help me.
Thanks in Advance,
Giridhar
Hi Giridhar,
By using java scripts you can pass this to query template.
If you want to pass this to query template start dates and End Date
then use [SD] and [ED]
Other wise use the [Param.1] parameters.
Once you textbox is filled with date, on click call a javascript function.
In that function write,
For [SD] & [ED]
document.<appletname>.setStartDate(document.<textboxid>.value)
document.<appletname>.setEndDate(document.<textboxid>.value)
For [Param.1]
document.<appletname>.setParam(1, document.<textboxid>.value)
Hope this will give you an idea about about passing the date to query template.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Giridhar,
For clarification on Kishore's post, the proper syntax would be:
For [SD] & [ED]
document.<appletname<b>>.getQueryObject()</b>.setStartDate(document.<textboxid>.value);
document.<appletname><b>.getQueryObject()</b>.setEndDate(document.<textboxid>.value);
For [Param.1]
document.<appletname><b>>.getQueryObject()</b>.setParam(1, document.<textboxid>.value)
The key thing to remember is that the format of the string passed to the StartDate and EndDate query parameters must match the DateFormat parameter of the query template (default: MM/dd/yyyy HH:mm:ss). If the string passed into the dates doesn't match you will get a date parsing error. If the format of the string is passed to [Param.1] then it will be more or less up to the query and data source (Oracle, SQL, etc.) to be forgiving or not.
If you haven't already done so I would recommend making the input text field readonly and control the format through the javascript accessing your calendar object, this way the format needed for the query template can be controlled and will eliminate the manual user typing and then having to attempt to validate the string format in javascript.
Best Regards,
Jeremy Good
User | Count |
---|---|
12 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.