Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6068111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:40:50+00:00 2026-05-23T09:40:50+00:00

just wanted to ask how to put message in another line after the other.

  • 0

just wanted to ask how to put message in another line after the other. Here’s my code in my program:

function isEmpty(field,name,minVal, maxVal){
  var msg ="";
  if (field.val() >= minVal || field.val() <= maxVal){
    if ( field.val().length == 0){ 
      msg=(name + ' is empty.\n');
    }
  }
  else{
    msg=(name + ' inputted is invalid or number is more than 1000. \n');
  }  
  return msg;
}

function validateTallyReq(par){
  var msg= "Please read the following:";

  msg += isEmpty($('#tallyPlankNo'),'Plank Number ',1,999) ;        
  msg += isEmpty($("#tallyThick"), 'Thickness value',.9,999);
  msg += isEmpty($("#tallyWidth"), 'Width Value',.9,999);
  msg += isEmpty($("#tallyLength"), 'Lenght Value',.9,999);
  msg += isEmpty($("#tallyQty"), 'Quantity',1,3);

  if (msg == "")  { 

  } else {
    showMessage(msg);    
  }
  return false; 
}

this outputs message in one line. What I want is the message to output like:

Please read the following:

Plank Number is empty. 
Thickness value is empty. 
Width Value is empty. 
Lenght Value inputted is invalid or number is more than 1000. 
Quantity is empty. 

And one more question, I really dont know why it shows the length value is invalid though i dont input any value on it,. Please help.

EDIT

This is my showMessage function:

function showMessage(msg) {
  $('#dialog #message').text(msg);
  $('#dialog').dialog('open');
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:40:51+00:00Added an answer on May 23, 2026 at 9:40 am

    Try adding a <br/> to the message after each line. That will work if the the show() method is doing something like $("#displaydiv").html(msg);

    msg += "<br/>";
    

    As for the unexpected invalid message, it looks like the logic in this conditional is faulty:

    if (field.val() >= minVal || field.val() <= maxVal)
    

    Try making it

    if (field.val() >= minVal && field.val() <= maxVal)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

just wanted to ask where I define initial class properties? From other languages I
I just wanted to ask if iterators are valid after sorting or removal of
The code below works fine I just wanted to ask if I take out
Before asking for specific code examples, I just wanted to ask whether it is
I just wanted to ask, how can we open Java Applet like a program,
Hello everyone i am new to rails just wanted to ask What this line
Just wanted to ask you about the drawbacks (I mean memory or reponse time)
I just wanted to ask. I have text input to allow users to type
I just wanted to ask if it's possible to create a shopping cart with
I just wanted to ask if we can access an external MySQL server from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.