-2

I have a series of text boxes on a page, with common names Number and Scale:

<input type="text" name="Number">
<input type="text" name="Scale">

I also have my submit button:

<input type="SUBMIT" value="Process Now">

I am using jQuery on my webpage too - is there code that will check all instances of Number and Scale and not allow the user to submit until all the text Number and Scale text boxes have an entry in them?

Dustin Cook
  • 1,215
  • 5
  • 26
  • 44
  • 5
    What heve you tried? Your question _is there code that will check all instances of Number and Scale_ answer is __Yes__ – Satpal May 21 '14 at 14:24
  • [Yes, there is code that will check that](https://www.google.com/#q=jquery+form+validation) – ElGavilan May 21 '14 at 14:24

1 Answers1

1

Try this:

var emptytxt= $('[name=Number],[name=Scale]').filter(function () {
  return $.trim($(this).val()) == '';
});
if (emptytxt.length) { /* Error. has one or more empty txtboxes with name Number,Scale */ }
Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125