XModPro

JavaScript Assistance - TypeOf

Jeff M. Jeff M. asked Jun 4, 2020
Active Jun 5 · Viewed 2226 times
<p>Hello.. </p> <p>I need some JavaScript assistance. </p> <p>I have a drop-down which the end-user can select a class type; "Additions", "Classes" and "Descriptions". For "Additions" and "Classes", the class needs to be entered as a number. Where-as for the "Descriptions", it can be any alphanumeric character.<br><br>So, I'm trying to have JavaScript check the values and if they don't match the above criteria, the submission isn't OK'd. This is working; sort-of. </p> <p>I'm using TypeOf to get the value of the "classes" field. But the issue is, if I enter "1234" in this field, TypeOf always sees this as a sting because the TextBox is configured for a DataType="string". </p> <p>Is there anyway to get TypeOf to see this as what the value is entered? So for example, if "1234" is entered, TypeOf will see it as a number, or "BLD1" will be seen as a string. </p> <p>Thank you.. </p> <p><a href="http://dnndev.com/fiddle/fid/801" target="_blank">http://dnndev.com/fiddle/fid/801</a> </p>

3 Answers

Loading answers...