Uploading a text file via POST method - vbscript

I've been working on this problem for about a month now. I've seen dozens of web pages on the POST method and I just can't figure out how to use it.
I have this HTML form that posts data and a file up to a web site. this HTML form works great:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sample Post Request</title>
</head>
<body>
<form action="https://xxx.xxx.com//trackit/file/upload"
method="post" enctype="multipart/form-data">
<div>
<p>
File Name<select name="name">
<option value="" disabled="disabled" selected="selected">Select file name</option>
<option value="Customer">Customer</option>
<option value="Shipment">Shipment</option>
</select>
</p>
<p>
File Date:<input type="text" name="date"> format : YYYYMMDD
</p>
<p>
Upload File: <input type="file" name="file" />
</p>
</div>
<input type="submit" value="Upload It" />
</form>
</body>
</html>
However, I'm trying to automate this so I don't have to use the form. Here is what I have so far:
OPTION EXPLICIT
DIM sFile, sURL, sDate, sName, objStream
'File Type
sName = "Shipment"
'File Date YYYYMMDD
sDate = "20150717"
' File we are uploading
sFile = "C:\shipment.txt"
sBoundary = "|-O-|"
Set objStream = CreateObject("ADODB.Stream")
objStream.Type = adTypeText
objStream.Mode = adModeReadWrite
objStream.Open
objStream.LoadFromFile sFile
'Sending the data over HTTP Post
Set objHttp = CreateObject("MSXML2.XMLHTTP")
objHttp.Open "POST", "https://xxx.xxx.com//trackit/file/upload", False
objHttp.SetRequestHeader "Content-Type", "multipart/form-data; boundary=" + sBoundary
objHttp.Send "name=" + sName
objHttp.Send "date=" + sDate
Any help will be appreciated.

Related

How to maintain scroll position when submitting on toggle buttons - one form per toggle button

`I've been searching a lot, and I think the answer to my task is a call to an AJAX function. I'm using classic ASP. Please have in mind that I'm a total newbie. I really need someone to take my hand and tell me what to do. The examples I've found so far doesn't keep the same position on the website on submit. The idea is to press the toggle button (on/off) and save immidiately. That part is working perfectly. But when you have a lot of toggle buttons, and the submit gets you to the top of the page, you have a lot of scrolling down to do after every submit
The folowing is working just fine; either it's on or off. No need to do anything, but to press the toggle button. But if you are way down the webpage, you go way up to the top of the page, and you need to scroll way down to continue where you left off. This is where I want the page to be steady as a rock: Don't do anything on submit. Don't move up, don't move down. Stay put. I hope someone can help.
<%
If Request("mode") = "msgfromadmin" Then
Dim dato10, vUser10
dato10 = Day(Date) & "/" & Month(Date) & "/" & Year(Date) & " " & Time()
vUser10 = SQLEncode(Session("username"))
If Request.Form("msgfromadmin") = Lcase("on") Then
msgfromadmin = 1
Else
msgfromadmin = 0
End If
SQL = Conn.Execute("UPDATE usersettings SET msgfromadmin = " & msgfromadmin & " WHERE username = '" & SQLEncode(Session("username")) & "'")
Response.Redirect("/profile/mysettings/")
End If
%>
<head>
<style>
.switch{position:relative;display:inline-block;width:3.43em;height:1.75em;}
.switch input{opacity:0;width:0;height:0;}
.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s;}
.slider:before{position:absolute;content:"";height:1.26em;width:1.26em;left:0.25em;bottom:0.25em;background-color:white;-webkit-transition: .4s;transition:.4s;}
input:checked + .slider{background-color:#4d72ff;}input:focus + .slider{box-shadow: 0 0 0.063em #c4cbe7;}
input:checked + .slider:before{-webkit-transform:translateX(1.625em);-ms-transform:translateX(1.625em);transform:translateX(1.625em);}
.slider.round{border-radius:2.125em;}.slider
.round:before{border-radius:50%;}
</style>
</head>
<html>
<body>
<form name="msgfromadmin" action="/profile/mysettings/" method="post">
<input type="hidden" name="mode" value="msgfromadmin">
<div class="col-12 form-group row mt-4">
<div class="col-1 form-group text-center">
<label class="switch">
<input type="checkbox" name="msgfromadmin" onChange="this.form.submit();"<% If RSchosenSetting("msgfromadmin") = 1 Then %> checked<% End If %>>
<span class="slider"></span>
</label>
</div>
<div class="col-11 form-group">
Send a mail when there's a message from admin
</div>
</div>
</form>
</body>
</html>
Is it something like this you want??
You will have to obviously do the database connections etc on the submitpage.asp
I added the loop to the text and slider to generate a page that is longer.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>msgfromadmin</title>
</head>
<style>
.switch{position:relative;display:inline-block;width:3.43em;height:1.75em;}
.switch input{opacity:0;width:0;height:0;}
.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s;}
.slider:before{position:absolute;content:"";height:1.26em;width:1.26em;left:0.25em;bottom:0.25em;background-color:white;-webkit-transition: .4s;transition:.4s;}
input:checked + .slider{background-color:#4d72ff;}input:focus + .slider{box-shadow: 0 0 0.063em #c4cbe7;}
input:checked + .slider:before{-webkit-transform:translateX(1.625em);-ms-transform:translateX(1.625em);transform:translateX(1.625em);}
.slider.round{border-radius:2.125em;}.slider
.round:before{border-radius:50%;}
</style>
</head>
<html>
<body>
<form name="msgfromadmin" action="msgfromadmin.asp" method="post">
<input type="hidden" name="mode" value="msgfromadmin">
<div class="col-12 form-group row mt-4">
<%for i = 1 to 100 %>
<div class="col-1 form-group text-center">
<label class="switch">
<input type="checkbox" name="msgfromadmin<%= i %>" id="msgfromadmin<%= i %>" onChange="loadXMLDoc('<%= i%>','message <%= i%> from admin')" <% If request("msgfromadmin" & i) = "on" Then %> checked<% End If %>>
<span class="slider"></span>
</label>
</div>
<div class="col-11 form-group" id=adminmessage<%=i%>>
Send a mail when there's a message from admin
</div>
<% next %>
</div>
</form>
<script>
function loadXMLDoc(incoming, incoming2) {
var demoChecked = document.getElementById("msgfromadmin"+ incoming).checked;
if (demoChecked == true) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("adminmessage"+incoming).innerHTML = this.responseText;
}
};
xhttp.open("post", "SubmitPage.asp?msgfromadmin="+ incoming +"&message="+incoming2, true);
xhttp.send();
document.getElementById("adminmessage"+incoming).innerHTML = "Mail sent to admin";
} else {
document.getElementById("adminmessage"+incoming).innerHTML = "Send a mail when there's a message from admin";
}
}
</script>
</body>
</html>
and the SubmitPage.asp
<%
If Request("msgfromadmin") <> "" then
Dim dato10, vUser10
dato10 = Day(Date) & "/" & Month(Date) & "/" & Year(Date) & " " & Time()
response.write "Mail sent to admin at " & dato10
' vUser10 = SQLEncode(Session("username"))
' SQL = Conn.Execute("UPDATE usersettings SET msgfromadmin = " & msgfromadmin & " WHERE username = '" & SQLEncode(Session("username")) & "'")
End If
%>

Object Doesn't support this method

I am getting a
Object doesn't support this method
when I click the start button. It says the line is;
<input type="button" name="btnStart" id="btnStart" value="Start" onclick="Start_Button">
I believe it actually may be somewhere in my vbscript. When I click on the start button it depending on whether the strPath is entered and the checkbox is checked it should run the program to install, or tell me that I need to enter the strPath or check a box.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tombstone USD #1 - Software Installer</title>
<HTA:APPLICATION
APPLICATIONNAME = "Software Installer"
ICON = "images\districtlogo.ico"
ID = "NAME"
BORDER = "thick"
CAPTION = "yes"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "yes"
SYSMENU = "yes"
WINDOWSTATE="normal"
SCROLL = "no"
VERSION = "1.0"
INNERBORDER = "yes"
SELECTION = "yes"
MAXIMIZEBUTTON = "no"
MINIMIZEBUTTON = "no"
NAVIGABLE = "no"
CONTEXTMENU = "yes"
BORDERSTYLE = "normal"
/>
<script type="text/javascript">
<!--Resolution//-->
window.resizeTo(600,750);
</script>
<script language="VBScript">
Sub Start_Button()
Dim strAnswer,strPath, objNetwork
Set objNetwork = CreateObject("WScript.Network")
strAnswer = ""
strPath=""
If chkEset.Checked Then strAnswer = "Eset"
'If strPath is empty then nothing was checked.
If strPath = "" Then
Window.Alert "Please input Path location!"
End If
'If strAnswer is empty then nothing was checked.
If strAnswer = "" Then
Window.Alert "Please Make an Selection!"
Exit Sub
End If
Window.Alert "Done!"
End Sub
</script>
</head>
<body style="background-color:#E6E6FA">
<center>
<img src="images\districtlogo.png" alt="Logo" height="100" width="100"/>
<h1>Software Installer</h1>
</center>
<form name="MainMenu" action="" method="">
<label for="sPath">Drive Letter or File Path:</label><input type="text" size="60" id="sPath" name="sPath"></td>
<br />
<label for="Eset">ESet AntiVirus</label></td><input type="checkbox" id="Eset" name="chkEset">
<br />
<input type="button" name="btnStart" id="btnStart" value="Start" onclick="Start_Button">
<br />
<input type="reset" value="Reset">
</form>
</body>
</html>
I'm currently just trying to get this run with the one program. This is a proof of concept test.
Ok, since I figured it out I thought I would add the completed script below. All this does is check to see if the strPath is filled in and if the checkbox is checked. Next step is to get it to run a program that corresponds to the checkbox.
The way I fixed it was by changing the <input type="button" name="btnStart" id="btnStart" value="Start" onclick="Start_Button"> to <input type="button" name="btnStart" id="btnStart" value="Start" onclick="Start_Button()">.
I also realized that the Form wasn't actually assigning the values to the script and created TheForm value and assigned it to the MainMenu form. I then had to add that value to all the existing values.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tombstone USD #1 - Software Installer</title>
<HTA:APPLICATION
APPLICATIONNAME = "Software Installer"
ICON = "images\districtlogo.ico"
ID = "NAME"
BORDER = "thick"
CAPTION = "yes"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "yes"
SYSMENU = "yes"
WINDOWSTATE="normal"
SCROLL = "no"
VERSION = "1.0"
INNERBORDER = "yes"
SELECTION = "yes"
MAXIMIZEBUTTON = "no"
MINIMIZEBUTTON = "no"
NAVIGABLE = "no"
CONTEXTMENU = "yes"
BORDERSTYLE = "normal"
/>
<script type="text/javascript">
<!--Resolution//-->
window.resizeTo(600,750);
</script>
<script language="VBScript">
Sub Start_Button()
Dim strAnswer,strPath, objNetwork,TheForm
Set objNetwork = CreateObject("WScript.Network")
Set TheForm = Document.MainMenu
strAnswer = ""
strPath = ""
If TheForm.chkEset.Checked Then strAnswer = "Eset"
'If strPath is empty then nothing was checked.
If TheForm.strPath = "" Then
Window.Alert "Please input Path location!"
Exit Sub
End If
'If strAnswer is empty then nothing was checked.
If strAnswer = "" Then
Window.Alert "Please Make an Selection!"
Exit Sub
End If
Window.Alert "Done!"
End Sub
</script>
</head>
<body style="background-color:#E6E6FA">
<center>
<img src="images\districtlogo.png" alt="Logo" height="100" width="100"/>
<h1>Software Installer</h1>
</center>
<form name="MainMenu" action="" method="">
<label for="Path">Drive Letter or File Path:</label><input type="text" size="60" id="Path" name="strPath"></td>
<br />
<label for="Eset">ESet AntiVirus</label></td><input type="checkbox" id="Eset" name="chkEset">
<br />
<input type="button" name="btnStart" id="btnStart" value="Start" onclick="Start_Button()">
<br />
<input type="reset" value="Reset">
</form>
</body>
</html>

ASP Visual Basic Code Crashing...Help Much Required

I am trying to insert data into a oracle database
The data gets inserted and updates the database, however the page throws an error each time the insert statement finished even though the database was updated?
How can i fix this bug? Thanks!
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body>
<div class="page">
<h1>Connie's Control Panel</h1>
<div class="header">
<form action="" method="POST">
<table>
<tr>
<td>Supplier You Want To Update:</td>
<td><input type="text" name= "supplierName" required ></td>
</tr>
<tr>
<td>Supplier Name Updated:</td>
<td><input type="text" name= "supplierNameUpdated" required></td>
</tr>
<tr>
<td>Supplier Address Updated:</td>
<td><input type="type" name="supplierAddressUpdated" required></td>
</tr>
<tr>
<td>Supplier Rating Updated:</td>
<td><input type="type" name="supplierRatingUpdated" required></td>
</tr>
</table>
<input type="submit" name="submit" value="Submit">
</form>
<%
Dim objConnection
Dim objRecordset
Dim objUpdateSet
Dim nameCheck
Dim nameUpdate
Dim addressUpdated
Dim ratingUpdated
nameCheck = Request.Form("supplierName")
nameUpdate = Request.Form("supplierNameUpdated")
addressUpdated = Request.Form("supplierAddressUpdated")
ratingUpdated = Request.Form("supplierRatingUpdated")
Set objConnection = Server.CreateObject("ADODB.Connection")
With objConnection
.ConnectionString = "Provider=MSDAORA.1;Password=DELETED;User ID=n011266e;Data Source=stora;Persist Security Info=True"
.Open
Set objRecordset = .Execute("SELECT * FROM Suppliers")
if nameCheck<>"" then
Do while (Not objRecordset.eof)
Set objRecordset = .Execute("UPDATE Suppliers SET SupplierName =" & "'" & nameUpdate &"'" & "WHERE SupplierName =" &"'" & nameCheck&"'")
objRecordset.MoveNext
Loop
end if
End With
objConnection.close
Set objConnection = Nothing
Set objRecordset = Nothing
Set objUpdateSet = Nothing
%>
</div>
<div class="buttons">
<i class="icon-white icon-pencil"></i> Enter Stock
Stock Report
<i class="icon-white icon-pencil"></i> View Suppliers Details
<i class="icon-white icon-pencil"></i> New Supplier
<i class="icon-white icon-pencil"></i> Edit Supplier
</div>
</div>
</body>
</html>
I guess you need not do "SELECT * FROM Suppliers" and Do while loop
you can directly execute
"UPDATE Suppliers SET SupplierName ='nameUpdate' WHERE SupplierName ='nameCheck' "
may be your getting error because your executing on "objRecordset = .Execute(.. ) " which already has select.

How to get domain name in vbscript for windows 2012 server R2?

This worked in windows 2008 server R2, but not on windows 2012 server R2. What is the equivalent in 2012?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AD Manager</title>
<script language="vbscript" type="text/vbscript">
<!--
Sub Validate
Dim objSysInfo, owsh
Set objSysInfo = CreateObject("ADSystemInfo")
Set owsh = CreateObject("WScript.Network")
username = owsh.username
domain2 = objSysInfo.DomainShortName <==== This is the line that fails
document.getElementById("UserName").value = domain2 & "\" & username
document.getElementById("Password").value = "1234"
document.getElementById("frmADManager").submit()
End Sub
//-->
</script>
</head>
<body onload="Validate()">
<form id="frmADManager" action="ProcessLogin.asp" method="post">
<input type="hidden" id="UserName" name="UserName" value="" />
<input type="hidden" id="Password" name="Password" value="" />
</form>
</body>
</html>
You appear to be mixing VBScript with JavaScript in a possibly awkward way.
Here is one method that should work with either OS. There are many ways you could achieve this in a single language. I am surprised that the code you were using actually works on Windows 2008 R2 (yes, I know it does - I just tested it).
Take a look at this article for more information on how you can mix client side JavaScript with VBScript on the same page: http://msdn.microsoft.com/en-us/library/aa260861(v=vs.60).aspx
In this example, we have split your VBScript and JavaScript into separate scripts, where one calls the other.
Tested to work on Windows 2008 R2 and Windows 2012 Server.
NOTE: I do not recommend storing passwords like this in a production environment. Anyone can intercept this password as it loading client side. Presumably you are also using HTTP - the password will be visible in clear text. Consider a more secure alternative - as I am not sure why you are doing this or where you are feeding these credentials, I can't offer you a suggestion as to how to change things.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AD Manager</title>
<script language="vbscript">
function getDomainInfo()
Dim objSysInfo, owsh
Set objSysInfo = CreateObject("ADSystemInfo")
Set owsh = CreateObject("WScript.Network")
username = owsh.username
getDomainInfo = objSysInfo.DomainShortName & "\" & owsh.username
End function
</script>
<script language="javascript">
function validate()
{
document.getElementById("UserName").value = getDomainInfo();
document.getElementById("Password").value = "1234";
document.getElementById("frmADManager").submit();
}
</script>
</head>
<body onload="validate()">
<form id="frmADManager" action="ProcessLogin.asp" method="post">
<input type="hidden" id="UserName" name="UserName" value="" />
<input type="hidden" id="Password" name="Password" value="" />
</form>
</body>
</html>

How do I modify a .html file to give hardcoded inputs to input fields every time?

I want to access my Powerschool (powerschool.avon.k12.ct.us), and I find the need to type in my password and username every time rather tedious. To try and fix this I downloaded the page's source in Chrome, below:
<!DOCTYPE html>
<!-- saved from url=(0052)http://powerschool.avon.k12.ct.us/guardian/home.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Parent Sign In</title>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta name="robots" content="noindex">
<link href="./Powerschool_files/screen.css" rel="stylesheet" type="text/css" media="screen">
<meta name="viewport" content="width=device-width">
<script src="./Powerschool_files/jquery-1.4.2.min.js"></script><style type="text/css"></style>
<script language="JavaScript" src="./Powerschool_files/md5.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript"><!--
var pskey = "4EDE156E2FAD0F1A427D2AD066530F496ADC3EEA78CE43E70F28053576FD4EA1";
//-->
</script>
<script language="JavaScript" type="text/javascript">
function deleteCookie(cookieName){
var cookieDate = new Date();
cookieDate.setTime(cookieDate.getTime()-1);
document.cookie = cookieName + "=; expires='" + cookieDate.toGMTString()+"'; path=/";
}
deleteCookie("InformAuthToken");
function getURLParameter(name) {
return unescape(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
var $j = jQuery.noConflict();
$j(document).ready(function() {
// Hide or show the translator login input field
// if the URL parameter "translator" is present
var translator = getURLParameter("translator");
if (translator == "null") {
$j('#translatorInput').hide();
} else {
if (translator == "true") {
$j('#translatorInput').show();
} else {
$j('#translatorInput').hide();
}
}
$j('a.popWin').click(function(){
var winURL = $j(this).attr('href');
window.open(winURL);
return false;
});
});
</script>
</head>
<body class="pslogin" id="palogin">
<div id="container">
<div id="branding-powerschool"><img src="./Powerschool_files/ps7-logo-lrg.png" alt="PowerSchool" width="280" height="41"></div>
<div id="content" class="group">
<form action="./Powerschool_files/Powerschool.htm" method="post" name="LoginForm" target="_top" id="LoginForm" onsubmit="doPCASLogin(this);">
<input type="hidden" name="pstoken" value="2465670387a1nxrEimrKqPMN0c7QbxxKLNZe16PRC">
<input type="hidden" name="contextData" value="4EDE156E2FAD0F1A427D2AD066530F496ADC3EEA78CE43E70F28053576FD4EA1">
<input type="hidden" name="dbpw" value="">
<input type="hidden" name="translator_username" value="">
<input type="hidden" name="translator_password" value="">
<input type="hidden" name="translator_ldappassword" value="">
<input type="hidden" name="returnUrl" value="">
<input type="hidden" name="serviceName" value="PS Parent Portal">
<input type="hidden" name="serviceTicket" value="">
<input type="hidden" name="pcasServerUrl" value="/">
<input type="hidden" name="credentialType" value="User Id and Password Credential">
<h2>Parent Sign In</h2>
<!--box content-->
<div id="noscript" class="feedback-alert" style="display: none;"> To sign in to PowerSchool, you must use a browser that supports and has JavaScript enabled. </div>
<fieldset id="login-inputs" class="group">
<div>
<label>Username</label>
<input type="text" id="fieldAccount" name="account" value="" size="39">
</div>
<div>
<label>Password</label>
<input type="password" name="pw" value="" size="39"><div id="login-help">Having trouble signing in?</div>
</div>
<div id="translatorInput" style="display: none;">
<label>Translator Sign In</label>
<input type="password" name="translatorpw" value="" size="39">
</div>
<div class="button-row">
<button type="submit" id="btn-enter" title="Sign In To PowerSchool Parent Access" value="Enter" border="0">Sign In</button>
</div>
</fieldset>
<!-- box content-->
</form>
</div>
<div id="footer" class="group">
<p>Copyright© 2005 - 2013 Pearson Education, Inc., or its affiliate(s). All rights reserved.</p>
<p id="pearsoncorplink">Join us on Facebook</p>
</div>
</div>
<div id="branding-pearson">
<div id="logo-pearson"></div>
<div id="tagline-pearson"></div>
</div>
<script type="text/javascript">
/**
* Set the page's locale via a request_locale URL parameter. If there is already a URL parameter by
* this name, then substitute it with the passed-in locale. NOTE: This function will actually cause the page
* to be re-submitted with the new locale, so it really should not be used with pages submitted via POST
* requests (if there are any, which I hope there are not).
* #param locale the locale to set (e.g. en_US)
*/
function setPageLocale (locale) {
var c=String (window.location);
var rlpos = c.indexOf("request_locale=");
var afterPart = "";
if (rlpos > 0) {
var afterBegin = c.indexOf("&", rlpos);
if (afterBegin > 0) {
afterPart = c.substring(afterBegin);
}
c = c.substring(0, rlpos-1);
}
var s=(c.indexOf('?') > 0 ? '&' : '?');
var np = c + s + 'request_locale=' + locale + afterPart;
window.location = np;
}
function jsCheck() {
document.getElementById("login-inputs").className = 'group';
}
jsCheck();
</script>
<script>
$j('#noscript').hide();
function jsEnabled() {
if(typeof $j != 'function'){
alert('Developer: This page is missing key components required for functionality!\n\nPossible causes include:\n - Commonscripts might be missing.\n - Page customization might enabled, and incomplete.');
//document.write('<script...');
} else {
$j('#login-inputs').removeClass('hide');
$j("#fieldAccount").focus();
}
}
$j(document).ready(function(){
jsEnabled();
});
</script>
</body></html>
I was wondering if it was possible to directly modify the downloaded source to automatically fill the input boxes (the below block is where I think it would be done) to always fill in the username and pass fields with "myUsername" and "myPassword," or something like that. I tried setting the value of the Input and Username fields, but that (chrome) gave me an, shown here:
No webpage was found for the web address: file:///C:/Users/Me/Desktop/Powerschool_files/Powerschool.htm
Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.
Do you guys know how this could be done?
Instead of copying the entire page, it's probably simpler to make a bookmarklet that fills in the form. Just edit a normal bookmark and change the link to be this:
javascript:(function() { document.forms[0].elements[0].value="hi" })()
That will set the value of the first field in the first form. (It may take some experimenting to see which form number and which field number.)
You can probably use Chrome to remember your passwords for you automatically, but what you have should actually work. You just need to change any paths to urls for it to work perfectly. One that you definitely need to change is the form action:
- ./Powerschool_files/Powerschool.htm
+ https://example.com/Powerschool_files/Powerschool.htm
This should allow you to submit directly to that site unless they have a CSRF token in the form that I don't see.

Resources