Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
2 answers
919 views

Validate Email as User is typing (JavaScript)

I have the following javascript function validateEmail(value). The goal of the function is to validate the users inputted email as they are typing. So if someone puts nfg@*gmail.com the email will be ...
Nick Gallimore's user avatar
5 votes
5 answers
495 views

Calculate LIX value of a text

I've been building a simple tool to calculate the LIX value of a text (a standard measurement of the readability of a text). My approach was to have every step of the calculation as seperate ...
Mark Buskbjerg's user avatar
0 votes
1 answer
280 views

Converting Confluence markup to a simpler XML format

I have a code that converts one xml structure to another. I am removing unnecessary tags and replacing some temporarily. I think I have way too many replace operations and wondering if there is a way ...
Sejal Parikh's user avatar
3 votes
2 answers
143 views

Get a number from a class of a HTML element

I've got an element with multiple classes in a page and I need to dynamically get the number at the end of a specific class name. Example: ...
Claudio King's user avatar
-1 votes
1 answer
754 views

Javascript to PHP email validation? [closed]

So I'm working on an application where Javascript will first validate the email using a regex and then once sent to PHP, PHP will verify the user did not modify any of the javascript and validate the ...
Joe Scotto's user avatar
5 votes
2 answers
10k views

Using regex to replace strange characters

After importing some products from a csv strange characters have shown up on the page and it would be too much work to manually go to each product and remove them so I made this script to deploy on ...
ByteSettlement's user avatar
9 votes
2 answers
58k views

Restrict HTML input field to decimal

I'd like to restrict user input in a form to a decimal with max two numbers before and 4 after decimal point. Valid values would be: 50 0.1 1.23 4.5678 12.943 I'm ...
You Old Fool's user avatar
5 votes
1 answer
5k views

Truncating text with jQuery but keep the HTML formatting

I repeat here this answer on Stack Overflow. I first posted an answer with not finalized code, as a simple description of the solution I could think, without any test. But later I remained interested,...
cFreed's user avatar
  • 2,841
5 votes
2 answers
125 views

Parsing a URL from a document and matching it from an array

I need help in improving this script that I have written to parse a URL and check it from an array. This is what I have done till now: (fiddle) This is working fine. Was this done correctly? What ...
kannu's user avatar
  • 53
3 votes
0 answers
414 views

Efficient JavaScript/jQuery typewriter effect that handles HTML5, entities, and text

How should this code be improved? For instance: How could it be shorter, clearer, deal with memory better, use a plugin/library, better prepared for web input? I can break up and clarify the regex or ...
lette's user avatar
  • 31
1 vote
1 answer
85 views

Dynamically display relevant form elements

Here is a group of questions (hidden by default except the first one) with yes|no buttons ...
eaposztrof's user avatar
5 votes
3 answers
4k views

Regex match for a string in a URL

I feel like there is too much repetitive code going on here. All I am doing is doing a basic regex match for a string in the URL. If a match is found, I find a li ...
user3259232's user avatar
5 votes
1 answer
333 views

Communicating between plugins whilst maintaining context in Javascript

I'm making some changes to a JavaScript plugin on a site I've been made steward over. This main plugin has it's own sub-plugins and I'm trying to make certain aspects modular. Currently, I'm ...
tr3online's user avatar
  • 153
6 votes
2 answers
221 views

Performance tuning on a text file to object conversion

I'm using an API which returns text in the following format: ...
Johan's user avatar
  • 631
1 vote
1 answer
3k views

Disallowing repeated characters and space after punctuation

I'm trying to "sanitize" a textarea input by disallowing repeated characters like "!!!", "???", etc. add spaces after commas, and I would like to optimize the code because I'm not a pro at this. ...
Santiago's user avatar
  • 111

15 30 50 per page