troubleshooting Question

Getting error: Microsoft JScript runtime error: Object doesn't support this property or method

Avatar of dawesley
dawesleyFlag for United States of America asked on
JavaScriptWeb DevelopmentASP.NET
5 Comments1 Solution3603 ViewsLast Modified:
I'm programming in Visual Studio 2005.
I have an web page with an HTML (not ASP HTML) dropdownlist object.
I can't use 'runat=server' on the dropdownlist because it contains literals
and Microsoft won't accept them.
I want to return the value of the dropdownlist to the ASP server.
To do this, I'm trying to store the value of the dropdownlist in a hidden text field.
The dropdownlist HTML looks like this (not showing entire list)

       <SELECT id=ddlCountry size=1 name=country_origin onchange='storeValue(this)'
            Style="z-index: 130; left: 416px; position: absolute; top: 328px">
            <OPTION selected>Select
            <OPTGROUP label="North American Countries">
            <OPTION value="United States">United
            <OPTION value=Canada>Canada</OPTION>
            <OPTION value=Mexico>Mexico</OPTION>

The hidden text field is:
       <input id="hdnCountry" style="z-index: 131; left: 288px; position: absolute; top: 464px"
            type="hidden" runat=server/>

The script that I'm running in the onchange event of the dropdownlist is:
        <script type="text/javascript">
           function storeValue(what)
           document.getElmentById('hdnCountry').value = what.value

When I select a value from the dropdownlist, I get the following error in the
Java script: Microsoft JScript runtime error: Object doesn't support this property or method

Much thanks to anyone who can help.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros