Do you have a form with checkboxes or radio buttons that you would like to loop through via JavaScript? This JavaScript function will do just that!
Tag Archives: javascript function
How to dynamically add content to a div and store the content to a cookie via JavaScript
This is an example of adding dynamic content via JavaScript by allowing the user type in the actual content.
How to validate email format via JavaScript
This JavaScript demo verifies that an email address is in the correct format and that the user has typed in the same address in both fields to prevent mistyping of the address. I have borrowed the regex for verifying the correct email format from a different site.
How to find and replace text dynamically via JavaScript
This is a neat little script that demonstrates two things:
1) Find – If only the Find box is filled in, then the findMyText() JavaScript function will just perform a find for the div that is given. If there is a match, the text will be highlighted and marked in bold.
2) Find and Replace – If both the Find and Replace boxes are filled in, then the findMyText() JavaScript function will do just that.
JavaScript to select all or none of the checkboxes in a form
Here is a quick demo of the select all or none JavaScript function that automatically toggles all of your checkboxes in a given form.
How to dynamically add form elements via JavaScript
Not all forms are meant to be static. Sometimes, you want to allow the users to add certain parts of the form as they need them. Here is a nice example of dynamically adding inputs to your form as users need them. In addition, an input limit has been implemented in the script and it is set to 3.
How to hide, show, or toggle your div
Are you trying to find a way to hide and show your content? The demo below shows a simple yet elegant way of toggling your content and toggling the control text via Javascript and styling.
We will cover how to implement this example later on in the tutorial but first let’s start with a simple example.