Skip to main content

Posts

Showing posts from October, 2019

Daily Java Script And jquery Usage

Daily Java Script And jquery Usage  How to get a query Parameter to an Input Field from client side. HTML code Url: http://172.16.1.51:8000/query.html?Business=cafe%20royale <script>     let urlParams = new URLSearchParams(location.search);     document.getElementById('BusinessInput').value=urlParams.get('Business'); </script> How to trigger clicked event with the Enter button key press for a Form submit button. problem : The tab navigation hovers the submit button , but clicking enter button doesn't work since it is not a button tag in html. document.getElementById('submit-button').addEventListener("keyup", function (event) {             if (event.keyCode === 13) {             document.getElementById("submit-button").click(); } Usual JS function hello=function () {    return   "Hello World!" ; } JS arrow function hello= () =...

Check Form Validity

Applova Home page Form Validation. This weeks task was to validate the data that is entered to the Autocomplete business Search Form I created previously. And the second form needed the same modifications. The user was to be restricted from submitting the following: Spaces  Words less than 2 characters Invalid emails The submit button has to be disabled if the three fields were not filled. Using minimal changes in the code this had to be done. And new libraries cannot be used. In that case jquery validation plugin was not an option. But it was the easiest one we had in mind. A small coding for form validation and the plugin script was to be added to solve this matter. But without using that plugin the form was validated and compromised of the invalid inputs as shown below. function getDemoHomeSectionClick () { var user_input = document. forms [ 'form' ][ 'SingleLine1' ]. value ; if ((user_input. trim ()). length < 2 ) { ...