如何使用JS代码加载php文件

Since I am new to JS coding and web designing, I have a following doubt:

I have one html page which has onclick function for form text area. If text area remains empty and user clicks submit, it should display message to enter entry and if entry is right one the corresponding file should get open. I have if/else condition in JS file, which is giving appropriate message while text area remains empty but not loading file which I am mentioning when entry is not empty.

Below is the html snippet:

<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta charset=utf-8>
</head>
<body>
    <form name="drugform" action="#">
        <pre> Drug Name<input type="text" name="name1" value="" /></pre>
        </p>

        <input type="button" value="Enter" onclick='buttoncheck()' />
    </form>
    <script type="text/javascript" src="if-else-button.js"></script>
</body>
</html>

and JS code is:

function buttoncheck() {
    if (Boolean(document.drugform.name1.value)) {
        load(form1.php);
    } else {
        alert('Enter Drug name');
    }
}

How to load file with js code (mentioned in if condition)?

var url = 'form1.php';
window.location.href = url;

Instead of load(form1.php), substitute the above code snippet!

EDIT:

If you want to load the file without actually redirecting to a new page, you can use jquery's .load() Check more about it here: http://api.jquery.com/load/

if you want to load that form1.php file in existing file then you can use ajax for for reference go here.

and if you want to redirect to another page then you should use

window.location.href = "form1.php";

try like this,

function buttoncheck() {
    if (document.drugform.name1.value != "") {  // check not empty condition
        load("form1.php"); // passing value to function with quotes
    } else {
        alert('Enter Drug name');
    }
}