Click here to Skip to main content
14,173,097 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I have the code Like

<script type="text/javascript">
        function saveCoOrdinate() {
            var offsetPanel = $("[id$=imgCertificate]").offset();
            var len = $(".dragMe").length;
            for (var i = 1; i <= len; i++) {

                var cont = $('.dragMe span:contains("' + i + '")').text();

                var offsetText = $('.dragMe:contains("' + cont + '") textarea').offset();

                var offsetTop = offsetText.top - offsetPanel.top;

                var offsetLeft = offsetText.left - offsetPanel.left;

                $("[id$=ddlBoxName]").append($("<option>" + cont + "</option>"));
                $("[id$=ddlXCoOrdinates]").append($("<option>" + offsetTop + "</option>"));
                $("[id$=ddlYCoOrdinates]").append($("<option>" + offsetLeft + "</option>"));
            }
            //document.getElementById("[id$=btnSaveValues]").click();
        }
    </script>


and drop down list


<asp:DropDownList ID="ddlBoxName" runat="server">
                </asp:DropDownList>
                <asp:DropDownList ID="ddlXCoOrdinates" runat="server">
                </asp:DropDownList>
                <asp:DropDownList ID="ddlYCoOrdinates" runat="server">
                </asp:DropDownList>

and the button


<asp:Button ID="btnSaveValues" runat="server" Text="Save" OnClientClick="saveCoOrdinate(); return false;"
UseSubmitBehavior="false" OnClick="btnSaveValues_Click" />
the onclick event is not working
Posted
Updated 1-Aug-14 1:18am
v3
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You are returning false in onClientClick event, hence the server click event won't fire. Remove it and execute.
   
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

   
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

use html dropdownlist.Then click will work
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190524.3 | Last Updated 5 Aug 2014
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100