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 385319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:28:05+00:00 2026-05-12T15:28:05+00:00

if(document.frmMain.POL_NO.value == ) { alert(Select Policy Number); document.frmMain.ENDT_NO.value=; document.frmMain.POL_NO.focus(); return false; } Can anyone

  • 0
if(document.frmMain.POL_NO.value == "")
{
    alert("Select Policy Number");
    document.frmMain.ENDT_NO.value="";
    document.frmMain.POL_NO.focus();
    return false;           
}

Can anyone explain the above code to me? I am new to Javascript.

  • 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-12T15:28:06+00:00Added an answer on May 12, 2026 at 3:28 pm

    It appears to be a bit of validation code to make sure a user has entered a value for an item referred to as “Policy Number”. It is the sort of code that gets called when submitting a form to check that the values the user has entered are valid.

    In detail:

    if(document.frmMain.POL_NO.value == "")
    

    Only run this code if the item called in POL_NO the form called frmMain doesn’t have a value yet.

    alert("Select Policy Number");
    

    Display a message to tell the user that they need to enter a value.

    document.frmMain.ENDT_NO.value="";
    

    Set the ENDT_NO item of frmMain to a blank value.

    document.frmMain.POL_NO.focus();
    

    Set the focus to the POL_NO item (the same as the user tabbing to it or clicking on it).

    return false;
    

    Return false to the code that called the function that this code is in. If this code is used in the event handler for the submit button on a form then returning false will stop the form from being submitted to the server until the POL_NO item has a value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jQuery(document).ready(function($) { $('input[type="text"]').live('focus', function() { if (this.value == 'someValue') { this.select(); } }); });
if (lVarScript == 'CN_TYPE') { parent.fnEffDateCheck(); document.frmMain.hidChgType.value = '1'; parent.fnChangeType(); } wat doest the
document.getElementById('contactButton').value = Sending; xmlhttp.onreadystatechange=stateChanged; xmlhttp.open(GET,url,false); xmlhttp.send(null); function stateChanged(){ if (xmlhttp.readyState==4) { var response =
document.getElementById('frmMain').elements can i use like this document.getElementByName('frmMain').elements or document.getElementBytag('table').elements`
document.forms[regform][fname].value; In java script i get the value of input having name(fname) which is
document.getElementById('container').addEventListener('copy',beforecopy,false ); In Chrome / Safari, the above will run the "beforecopy" function when
document.getElementById(...).setAttribute('style',... is not working in Internet Explorer 7.0. How can I make this work
document.addEventListener('contextmenu', function (e) { e.preventDefault() e.stopPropagation() e.returnValue = false e.cancleBubble = true }) No
document.all[ + object.getAttribute(EndDate, true) + ].value; does work in firefox but work in IE.
document.getElementsByTagName('a').item(0) and document.getElementsByTagName('a')[0] will return the same result... Is the former faster than the

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.