Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
247 views
in Technique[技术] by (71.8m points)

html - How to limit the text characters in the text input box depending on option chosen

Hi I am fairly new to coding and definitely a newbie. I am using shopify and trying to edit some of the code. I am trying to limit the text characters someone can enter into a text box depending on the option they chose. Currently i have a drop down tab where customers selects either 1-5 letters OR 6 letters OR 7 Letters. I would like that if they select 1-5 letters they cannot input 6 characters into the text box. The same should apply if they chose another option. I do not like the idea of having multiple text input boxes. I want the same input box but for it to change the amount of characters it accepts depending on the option chosen. I hope this makes sense :) Thank you

question from:https://stackoverflow.com/questions/65876915/how-to-limit-the-text-characters-in-the-text-input-box-depending-on-option-chose

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You must use javascript for that purpose. Actually for having dynamic frontend you must use javascript. It doesn't matter if you do it with vanilla javascript, JQuery or other libraries and frameworks. I suggest you to google "javascript". And you can use w3schools.com to learn it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...