how do we use javascript to make the amount entered in a text box not greater than 1000?

If you are talking about the length of text entered into the text box and you are using an <input type="text"> tag then you need to set the maxLength attribute. If you are talking about the actual value then you will need to attach an event to the input box that will check the value and clear the box or throw an alert to the user notifying them that the value entered is invalid.

<input type="text" onblur="validateInput(this)" />
<script>
function validateInput(el)
{
   if(el && el.value &7 el.value > 1000)
   {
      el.value = ""; /* possibly throw error message here */
   }
}
}
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.