I am trying to add password in the form. I need the people to fill the form and also add a password provided by me to go to the next page.

I have added following code:

// For full API documentation, including code examples, visit Velo API Reference - Wix.com

import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
$w.onReady( function () {
//TODO: write your page related code here…

});

export function button6_click(event) { //
if

(($w(“#input3”).value !== ‘’ )||
($w(“#input1”).value !== ‘’ )||
($w(“#input2”).value !== ‘’ )||
($w(“#input4”).value === “password”))
wixLocation.to(“https://pmcresource.wixsite.com/website-2/copy-of-presentations”);
}

I wanted to sat if input 1,2 and 3 text box are not null and if value in 4 is equal to password then only go to the URL.
In this code, still the URL opens if input 3, 1 and 2 are null.

Also, I am not sure what will be the code for showing error message.

So, I wan to say:
if input 1,2 and 3 text box are not null and if value in 4 is equal to password then only go to the URL. else show the error

Use && instead of ||
You can also make it shorter:
Set the fields to “required” and:

let inputFields = [ $w("#input1"), $w("#input2"), $w("#input3"), $w("#input4")]
 export function button6_click(event) { 
  if (inputFields.every(e => e.valid) && $w("#input4").value === "password"){
   wixLocation.to("https://pmcresource.wixsite.com/website-2/copy-of-  presentations"); 
 }
}