开发者

Control not reaching to .js function

In my following code, I am calling function "Make Request" that is located in a separate .js file. But the control is not reaching to this function. I have also added the link to the related file.

<link rel="section" href="../Lib/ajaxhandler.js" type="text/javascript">

<td oncontrolselect="MakeReque开发者_JAVA技巧st('inCategory','SELECT * FROM electioncategorymaster', 'ecid', 'ecname');">
    <select id="inCategory" name="inCategory" class="entryFormInputBoxColor">

    </select>
</td>

I want to make a call to the MakeRequest function when page is rendered. On which event I must call the function?


Your link to the script is wrong. The link tag is useful for e.g. stylesheets.

Your script tag should be like this:

<script src="../Lib/ajaxhandler.js" type="text/javascript"></script>

Also, you may want to catch the oncontrolselect event of the combo box instead of the td.


How about this...

<script src="../Lib/ajaxhandler.js" type="text/javascript"></script>

<td>
    <select id="inCategory" name="inCategory" class="entryFormInputBoxColor" 
            onChange="MakeRequest('inCategory','SELECT * FROM electioncategorymaster', 'ecid', 'ecname');">

    </select>
</td>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜