JavaScript pattern matching using Regular Expression(RegEx)

If we want to match special character, meta character or using quantifers , we can do that by regular expression. For eg. If we want to match date , time or any particular pattern or complex things we can use it. Regular expressions allow you to check a string of characters like an e-mail address… Continue reading JavaScript pattern matching using Regular Expression(RegEx)

Change the display block : none to block and vice versa.

While designing a web page especially the header it is important to know to change the content to none to block and vice versa by using Java Script. It will be very helpful when we develop a responsive NavBar. The java script code used for this is as follows:- function toggleFunction() {       … Continue reading Change the display block : none to block and vice versa.

Section 1 | JavaScript Coding Standard

1. Naming conventions Naming conventions in Javascript are a set of guidelines used to name variables, functions,classes, and other identifiers in a consistent and readable manner. Some common namingconventions in Javascript are: CamelCase: This is a convention where the first word is in lowercase and the firstletter of the second word is capitalized, without using… Continue reading Section 1 | JavaScript Coding Standard

ES6+ Features to Adopt in SuiteScript 2.1

SuiteScript version 2.1 is out of beta and beginning on the 2021.1 release, all SuiteScript 2.x scripts will be running as SuiteScript 2.1 by default, so you had better test your existing scripts for any bugs or declare them as v2.0 and wait until a later time to validate. To change your scripts to use SuiteScript v2.1… Continue reading ES6+ Features to Adopt in SuiteScript 2.1

How to Create Expandable boxes with Plus and minus on accordion using the java script

In the NetSuite when we give the Product information from the tab data for an item it will be displayed in the website for the particular item.  The Product information will be displayed here under the product details section.  When we click on the “+” button the Product information will be expendable and show the… Continue reading How to Create Expandable boxes with Plus and minus on accordion using the java script

How to shrink a header on scroll with CSS and JavaScript.

Step 1) Add HTML: Create a header: Example Code: <div id=”header”>Header</div> Step 2) Add CSS: Style the header: Example Code: #header {   background-color: #f1f1f1; /* Grey background */   padding: 50px 10px; /* Some padding */   color: black;   text-align: center; /* Centered text */   font-size: 90px; /* Big font size */   font-weight: bold;   position: fixed; /* Fixed position – sit on top of… Continue reading How to shrink a header on scroll with CSS and JavaScript.

How to Trigger JavaScript change event when value is not different

The ‘change’ event listener will only trigger when the value of the input changes, so if the same id is selected, no change would be triggered, and the event will not show. For instance, if you’re creating an AJAX uploader and want to do something with the information in the file input, you could always… Continue reading How to Trigger JavaScript change event when value is not different

How to create a collapsible section with CSS and JavaScript.

A Collapsible Section makes a section, or group of fields, collapsible. It is useful when there are several sections in your form and you want them to take up less vertical space. Create A Collapsible Section Step 1) Add HTML Example Code: <button type=”button” class=”collapsible”>Open Collapsible</button> <div class=”content”>   <p>Lorem ipsum…</p> </div> Step 2) Add CSSStyle the accordion: Example… Continue reading How to create a collapsible section with CSS and JavaScript.

Date format using moment.js

MomentJS is a JavaScript library which helps in parsing, validating, manipulating and displaying date/time in JavaScript. Its parsing allows you to parse the date in the format required. Parsing of date is available in the string, object and array. You can use the method isValid() and check whether the date is valid or not. MomentJS also provides… Continue reading Date format using moment.js

Java Script – encodeURI() & decodeURI()

encodeURI():This function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character. It returns a new string representing the provided string encoded as a URI. This method does not encode characters like: , / ? : @ & = + $ * #Use the encodeURIComponent() method instead. decodeURI():This function… Continue reading Java Script – encodeURI() & decodeURI()