Solved

basic JS question:  greater than 0 but less than x?

Posted on 2014-01-29
2
321 Views
Last Modified: 2014-01-29
function handleCharacterCheck(dialog) {
              if ($("#" + dialog).val().length < 300 ) {
                  $("#charNotEnough").html($("#" + dialog).val().length);
                  $("#dialogNotEnoughCharacters").dialog("open");
                  return false;
              }

I need to change that so that instead of the check being < 300, it must also be greater than 0.  (so greater than 0 and less than 300) How can I do that?
0
Comment
Question by:arthurh88
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
Phil Phillips earned 500 total points
ID: 39819610
Could do something like:

function handleCharacterCheck(dialog) {
              var len = $("#" + dialog).val().length;
              if (len > 0 && len < 300) {
                  $("#charNotEnough").html(len);
                  $("#dialogNotEnoughCharacters").dialog("open");
                  return false;
              }

Open in new window

0
 

Author Comment

by:arthurh88
ID: 39820134
yes, exactly!  thank you.
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question