How do I call a Javascript function on the back end Vb.net

114 Views Asked by At

I have these functions and I need to use them in them from the back end using:
UI.ScriptManager.RegisterStartupScript Do I need to change the functions or should I just be able to refer to them like they are. The functions are boostraps for calendars and a time picker.

  $('#timepicker').timepicker({
                uiLibrary: 'bootstrap4'
            });

            $('#timepicker2').timepicker({
                uiLibrary: 'bootstrap4'
            });



  $('input[type="radio"]').click(function() {
                if ($(this).attr("id") == "Radiobtn1") {
                    $(".datePicker1").show();
                    $(".datePicker2").hide();
                } else if ($(this).attr("id") == "Radiobtn2") {
                    $(".datePicker2").show();
                    $(".datePicker1").hide();
                }
            });
 $(document).ready(function () {
                var date_input1 = $('input[id="date1"]'); // date input has the name "date"
                var container = $('.cal1 form').length > 0 ? $('.cal1 form').parent() : "body";
                date_input1.datepicker({
                    format: 'mm/dd/yyyy',
                    container: container,
                    todayHighlight: true,
                    autoclose: true
                })

                var date_input2 = $('input[id="date2"]'); // date input has the name "date2"
                var container = $('.cal2 form').length > 0 ? $('.cal2 form').parent() : "body";
                date_input2.datepicker({
                    format: 'mm/dd/yyyy',
                    container: container,
                    todayHighlight: true,
                    autoclose: true
                })
            })
0

There are 0 best solutions below