[Solved] Javascript Hide-Unhide HTML Text Box

This is an issue with your selector you are selecting the drop-down with a name using a # sign: and there’s also a problem with your selector #ref-col in your JS it should be like this #ref_col change your name to id=”pf_status” in your HTML like this and this will work: $(document).on(‘change’, ‘#pf_status’, function() { … Read more

[Solved] How to assign a string to a variable in javascript when the string has a single quote in it

Replace single quote (escape it like PHP): <script> var quotes = “Empty” if(user.quotes) quotes = user.quotes.replace(/’/g,”\\\'”); // get the string to ‘quotes’ variable </script> Then wherever You use Your quotes, replace the “\’” back to “‘”. 0 solved How to assign a string to a variable in javascript when the string has a single quote … Read more

[Solved] how to add object in nested array of objects without mutating original source

Use Array.prototype.map instead, forEach gets no returns let newobj = [ { id: 22, reason: ‘reason 2’, phase: ‘phase 2’, reviewer: ‘by user 2’, date: ‘date 2’ }, { id: 21, reason: ‘reason 1’, phase: ‘phase 1’, reviewer: ‘by user 1’, date: ‘date 1’ } ]; let arr1 = { initiateLevel: true, parent: [ { … Read more

[Solved] how to remove some characters from string? [duplicate]

One way to do this might be to do a simple split() on the T character, and only taking the first segment: var dateAndTime = “2020-05-18T10:11:08Z”; var date = dateAndTime.split(‘T’)[0]; console.log(date); In a similar text manipulation vein, it’d also be possible to do something similar using RegExp, which might be helpful if you’d like to … Read more

[Solved] Busy Indicator while page is loading

You can try something like that: Display a loading-gif on your page: <div class=”loading”> <img src=”https://stackoverflow.com/questions/27108406/path/to/loading.gif” /> </div> And then hide it when the page is fully loaded: $(document).ready(function(){ $(‘.loading’).hide(); }); or hide it when some ajax-calls are completed: $(document).ajaxComplete(function() { $(‘.loading’).hide(); }); 0 solved Busy Indicator while page is loading