Input field for bank account number [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I need to create form input field for inputing bank account number. Than number has max = 18 number and min 18 numbers.
algorithm is next (3+13+2)
So i cant use clasic input text box i need special text box where i will have slash that separates that numbers like on screenshot:
How can i create textbox like above using javascript and html

This is very similar to this question: How to implement an input with a mask
The selected answer includes a link to a jQuery plugin that would work like this for your example:
$(function(){
$("#field").mask("999 - 9999999999999 - 99");
});
Of course javascript can't solve everything and inputs should be validated server side as well.

sometime ago I used a pluggin named "formatter.js" it is really easy to use, I will give you and example:
var formatted = new Formatter(document.getElementById('elementToFormat'), {
'pattern': '{{999}}-{{9999999999999}}-{{99}}',
'persistent': true
});
you can find that library to download and find the documentation in the following link, here or you can install that with bower
bower install formatter

Related

How can I change styling of portions of an input as the user types, using React? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Similar to many markdown editors, I would like to be able to modify portions of an input field as the user types. For example:
If the user types the above, immediately as the closing underscore is typed, the text should be styled as below.
And then if either (now faded and grey) underscore is removed, it reverts back to plain text and so on.
You can add styled-components to be able to change dynamically the style of the input. and add event linked to the typing like onKeypress
you can see more on the documentation

Point Per Total Price System [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
im trying to build something almost like a cashier system with php jquery and html
so im confuse about the point system
i got a simple input here :The input form
so the user will input their total price and base on that they'll get point ,
so for example user will get 1 poin every $10 , so when the user input $15 he's got 1 poin , and when the user input $13, he's still got 1 point, but when user input $20, he's gonna get 2 point , so thats basically thats how the system work, and my question is how to achieve that kind of system with php
you can use:
$points = floor($price/10);

Autohint user input as he enters text [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What I'm struggling to find a way to achieve is a way to auto complete the input itself while users type.
As an image worth more than a thousand words I'm basically looking to replicate the same behaviour that you can experience in the city search input of Airbnb
Image to see the input in action
Does anyone have an idea of how I can make an input that have a similar behaviour ?
PS : I'm not looking for a code implementation, just hints about how do you think this can be achieved
I think what you are looking at is called as typeahead. You can use Twitter's typeahead. There are plethora of tutorials, documentation and code snippets available for typeahaed implementation. Here is an example of twitter's typeahead.

How to make textarea with tagging feature like in Youtube [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to create a textarea that behaves like the tagging box in Youtube. Specifically:
Allow you to type whatever you want
When you press space it turns the word you just typed into a tag
You can remove tags with backspace or by clicking x on tags
Show suggestions as you type
You can add tags from outside the textarea as well
Also, what exactly is this method called?
I just used a javascript library 2 days ago that does excatly this. Check out the TextExtJs library

Get number with javascript [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a Javascript Bookmarlet, in which I want to grab a price that might be displayed on the current page.
So for example on shopping sites it could grab the price of an item the user is currently looking at.
I figured one way would be to grab all the text on the page, perhaps with something like get web page text via javascript
And then from there filter to get just the number after a currency symbol is found (£,$ etc) which should in theory leave just the Price.
However I am now sure how I would go about actually filtering to just the number, and if this is at all the right way to go about this?
How about get the text value of mark up?
E.g. Say you had:
<span id="price">£5.00</span>
You could do the following with jQuery:
$('#price').text();
Or vanilla javascript:
document.getElementById('price').innerText
Provided there is infact a wrapper around the text or you have access to the markup.

Categories

Resources