locked
Javascript/Jquery - Call html page objects (example text input, button, etc..) from the page to .js file RRS feed

  • Question

  • User135423268 posted

    Good Day Everyone

    I'm new on using Javascript and Jquery, right now i have created scripts on my page, but I realized that I have too many scripts on page, I want to put it on a javascript file, but I having problem when calling objects to javascript file, here a example of what I want to do, my page name is "createprocess"

    function ModPopUpHideShow1(modpopupname,hideShow)
    {
     switch(modpopupname)
     {
       case 'modpop1':
        switch (hideShow)
        {
           case 'show':
             $('#modpop1').modal('show');
           break;
           case 'hide'
            document.getElementByID("labelError1").innerHTML = "";
            document.getElementByID("txtSearch1").innerHTML = "";
            $('#tblTemp1 tbody').empty();
            $('#modpop1').modal('hide');
           break;
        }
        break;
       case 'modpop2':
        break;
     }
    
    }

    As you can see I have called objects that clear the value and the table data row, now what I want to do is, is to transfer does codes to my js file which is myscripts.js file, and when I called it, I want it to do the same functionality as when declared on the page. will this be possible? 

    Thanks and Regards

    Friday, June 29, 2018 3:03 AM

All replies

  • User135423268 posted

    Hi everyone please disregard this, I have fix the problem, it's on calling the javascript file. thanks

    Friday, June 29, 2018 3:39 AM