Jump to content

Search the Community

Showing results for tags 'onload'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 2 results

  1. I have been working on this problem for a while now and don’t seem to be able to find a solution and was wondering if someone could help. I have a form which is submitted and passes two form object values and saves them to a text file held on the server, this works ok. After the submit button is pushed the file is saved with the function <?--#exec cmd_argument='SaveToFile("settings.cfg","#",Overwrite)'--> I read back the contents of the file and try to set the "selectedindex" on my speedUnits and rateUnits option list, however the option lists "selectindex" does not seem to update. I use an "input" "hidden" text field to hold the contents of the text file which is read in with the function <?--#exec cmd_argument='IncludeFile("settings.cfg")'--> My main HTML and Javascript are shown below and I was hoping something could give me some pointers. The "settings.cfg" contains designUnits#3 speedUnits#0 save#Submit Query settingsFile# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR...tml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="content-type" charset="utf-8"> <link rel="stylesheet" type="text/css" href="css/styles.css" media="screen"> <title>Siemens BW500</title> <script type="text/javascript" src="js/convert.js"></script> </head> <body> <div id="outer_wrapper"> <div id = "wrapper"> <div id = "banner"> <h1>BW500</h1> </div> <div id ="logo"> <img src="images/logo_siemens.jpg"> </div> <div id ="topnav"> <ul> <li><a id="onlink" href='index.html'>Process</a></li> <li><a href='status.html'>status</a></li> <li><a href='control.html'>Control</a></li> <li><a href='PID.html'>PID</a></li> <li><a href='spa.html'>Parameters</a></li> <li><a href='Manuals.html'>Manuals</a></li> <li><a href='network.html'>Network</a></li> </ul> </div> <div id ="data"> <form action="settings.html" method="get" id="unitsSetup" name="unitsSetup"> <table> <tr> <td>Design Units</td> <td><select name="designUnits"id="designUnits"> <option value="0">T/h(tons / hour)</option> <option value="1">t/h (tonnes / hour)</option> <option value="2">LT/h(long tons) / hour</option> <option value="3">kg/h (kilograms / hour)</option> <option value="4">lb/h(pounds / hour)</option> <option value="5">kg/min (kilograms / minute)</option> <option value="6"> lb/min (pounds / minute)</option> </td> </tr> <tr> <td>Design Speed Units</td> <td><select name="speedUnits" id="speedUnits"> <option value="0">Feet/min</option> <option value="1">Metres/s</option> </td> </tr> <tr> <td><input type="submit" name="save"></input></td> </tr> </table> <input type="hidden" name="settingsFile" id="settingsFile"value="<?--#exec cmd_argument='IncludeFile("settings.cfg")'-->"></input> <script language="javascript" type="text/javascript">readFileSettings()</script> </form> <?--#exec cmd_argument='SaveToFile("settings.cfg","#",Overwrite)'--> </div> <div id ="copywrite"> <p>Copywrite</p> </div> </div> </div> </body> </html> The Javascript function "readFileSettings() is shown below. function readFileSettings() { var readFile,designUnits,speedUnits; readFile =document.getElementById('settingsFile').value; designUnits = readFile.charAt(12); speedUnits = readFile.charAt(25); document.getElementById('speedUnits').selectedIndex = speedUnits; document.getElementById('designUnits').selectedIndex = designUnits; }
  2. Hello internet.Here is my most recent dilemma. I have been creating WebPages without declaring a DOCTYPE. W3Schools forum members corrected that problem I was making. The issue now is that I have gone back and declared a doctype with all my pages and now I am cleaning up the problems. A big problem is getting the window.onload JavaScript function to work. Here is what I am doing, I am declairing this DOCTYPE<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> I am using the following javascript code - Tload is an array I created from mysql database $json = json_encode($rows);echo '<script type="text/javascript">var Tload = '.$json.';</script>';<script type="text/javascript">window.onload = function() {for (var i = 0; i < Tload.length; i++) { document.getElementById(Tload.id).value = Tload.value; } } The array values are not loading to my webpage... Please help.
  • Create New...