Skip to content

Tag: forms

JS Onchange display value before processing

I have a form with a select input element. After the user selects an option, I check that option chosen. If it is bigger than I expected, I bring up an alert box asking the user if they’re sure they selected the right option. This is just a warning, so I don’t reset the value or prevent the user from

How do I change this variable using radio buttons?

Hello I’ve been tearing my hair out over this all last night and this morning, I have a radio button set with 3 options and I have a variable called “Minimum_fare”. I’m trying to write javascript that will set the variable “minimum_fare” to a different number depending on which radio button is selected. I’ve looked at dozens of answers on

Search by post title wordpress without reflesh

I want to create wordpress search by title without refleshing page. New results have to be shown when more than 3 symbols are typed in search. I’ve got input with form: But when I’m typing – value of input is not changing. How can I search posts after typing 3 symbols if I cannot get input.value.length? Also how can I

Form validation – Must contain a specific word from a list

I’m trying to use Javascript to validate an input field to have the specific formatting below: “WORD1,WORD2” So there has to be a comma in between two words, no spaces. WORD1 can be any word, but WORD2 has to be a word from the following list: “USD”, “AUD”, “BTC”, “CAD”, “CHF”, “EUR”, “GBP”, “ETH”, “JPY”, “NZD” If the input field