I want to use a jQuery/JavaScript function to validate the input of a textbox.
I have pairs of checkboxes like this:
<input type="text" id="MinMondayTxt" />
<input type="text" id="MondayTxt" />
this is for each day of the week (MinTuesdatTxt, MinWednesdayTxt...)
The Function is like this:
function ValidateTxt(TxtId){
}
It take the Id of a textbox as input. What I want to do is the following:
1) Check if the Id starts with "Min"
2) Get the corresponding textbox, by removing "Min" from the id. for example if we have MinMondayTxt I want to remove the "Min" in order to access the MondayTxt textbox
3) Compare the the values of the 2 textboxes (all values are numeric)
4) if MinMondayTxt > MondayTxt Alert the user
I am looking for help for step 1) and 2) : How can I check if the id starts with "Min" and how to get the corresponding textbox id (by removing the min)