dalton.lesko088
Baseband Member
- Messages
- 55
- Location
- USA
I need to write an if statement to "validate" an input in a form. i have no idea where to start. for instance, one of my inputs' code is for a first name input where the first letter has to be capitalized. the code is:
<div class="FirstName">First Name:
<input title="First Name With first letter Capitalized"
name="FirstName"
placeholder="Dalton"
type="text"
pattern="[A-Z] {1} [a-z] *"
class="check"
id="FName"
tabindex="1"
required />
</div>
plus, i want it to be validated on the push of this button:
<div class="validate">
<input type="submit" value="Validate Form and Calculate Tax" /> </div>
so i have a function in javascript called "Calculate ()" which is where i want to put the if statement. anyone have any suggestions?
<div class="FirstName">First Name:
<input title="First Name With first letter Capitalized"
name="FirstName"
placeholder="Dalton"
type="text"
pattern="[A-Z] {1} [a-z] *"
class="check"
id="FName"
tabindex="1"
required />
</div>
plus, i want it to be validated on the push of this button:
<div class="validate">
<input type="submit" value="Validate Form and Calculate Tax" /> </div>
so i have a function in javascript called "Calculate ()" which is where i want to put the if statement. anyone have any suggestions?