Nelson3000
asked on
In HTML, how do I trigger a Postback after a ComboBox value is updated?
Please Help!!!
I have a page with a ComboBox.
I want to trigger a Postback when the ComboBox is updated.
Am I on the right track with the following code?
-------------------------- --------
--------
The ComboBox is displayed properly. But the Postback is not triggered when a new value is selected.
I am new to HTML and have a project that I need to complete ASAP. Any help would be greatly appreciated.
Many Thanks,
Nelson
I have a page with a ComboBox.
I want to trigger a Postback when the ComboBox is updated.
Am I on the right track with the following code?
--------------------------
<Script>
function ComboChange(obj) {
var comboValue = document.getElementById('MktReportSelectDate').value;
__doPostBack('MktReportSelectDate', comboValue);}
</Script>
<TR>
<TD ALIGN="RIGHT">Reporting Period: </TD>
<TD ALIGN="LEFT"><SELECT NAME="MktReportSelectDate" ID="MktReportSelectDate" OnChange="ComboChange()" >
<OPTION VALUE="Custom Date Period" SELECTED>Custom Date Period
<OPTION VALUE="First Quarter">First Quarter
<OPTION VALUE="Second Quarter">Second Quarter
<OPTION VALUE="Third Quarter">Third Quarter
<OPTION VALUE="Fourth Quarter">Fourth Quarter
<OPTION VALUE="This Year">This Year
<OPTION VALUE="Last Year">Last Year
<OPTION VALUE="This Month">This Month
<OPTION VALUE="Last Month">Last Month
</SELECT>
</TD>
</TR>
--------------------------The ComboBox is displayed properly. But the Postback is not triggered when a new value is selected.
I am new to HTML and have a project that I need to complete ASAP. Any help would be greatly appreciated.
Many Thanks,
Nelson
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the error in your console? Check the __doPostBack function scope .
ASKER
Thanks very much ste5an. Your solution worked perfectly.
Your assessment of what I was trying to accomplish was spot-on and your redesigned function was exactly what I needed.
For future reference, I will make sure to follow your recommendation about how to properly include code fragments in my questions.
Thanks again for the excellent solution and the HTML lesson.
Your assessment of what I was trying to accomplish was spot-on and your redesigned function was exactly what I needed.
For future reference, I will make sure to follow your recommendation about how to properly include code fragments in my questions.
Thanks again for the excellent solution and the HTML lesson.