How can I execute a function if a parameter equals a certain value

314
November 21, 2016, at 7:53 PM

I need to execute the below function if a param in the second script is equal to "date". The param value comes from a list of options, one of them is date.

Note my code is in update panel.

<script type="text/javascript">
    $(function () {
        $("#<%= txtsearch.ClientID %>").daterangepicker({
            locale: {
                format: 'DD/MMM/YYYY'
            }
        });
    });
</script>
<script type = "text/javascript">
    $(document).ready(function(e) {
        $('.search-panel .dropdown-menu').find('a').click(function(e) {
            e.preventDefault();
            var param = $(this).attr("href").replace("#", "");
            var concept = $(this).text();
            $('.search-panel span#search_concept').text(concept);
            $('[id$=hdnSearchParam]').val(param);
        });
    });
    // Re-Create for on page postbacks
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_endRequest(function() {
        $('.search-panel .dropdown-menu').find('a').click(function(e) {
            e.preventDefault();
            var param = $(this).attr("href").replace("#", "");
            var concept = $(this).text();
            $('.search-panel span#search_concept').text(concept);
            $('[id$=hdnSearchParam]').val(param);
        });
    });
</script>
Rent Charter Buses Company
READ ALSO
Transform Text to jQuery Functions

Transform Text to jQuery Functions

I'm working with jQuery, Javascript and NodeJs. .

435
jQuery Not Working in Eclipse

jQuery Not Working in Eclipse

Still a bit new with jQuery so I may be making a basic error. [nnn]I just completed the jQuery introductory course and now am trying to do some of my own basic work, but have hit a slight road block.

339
React: Uncaught TypeError: Auth.signinSuccess is not a function

React: Uncaught TypeError: Auth.signinSuccess is not a function

Im working on flux arquitecture with react. I have Auth.

428