Kompx.com or Compmiscellanea.com

JavaScript form submit

Windows : Internet Explorer 4.01+, Firefox 1.0+, Google Chrome, Opera 3.0+, Safari 3.1+, SeaMonkey 1.0+ [ 1 ].

Linux : Firefox 1.0+, Google Chrome / Chromium, Opera 5.0+, SeaMonkey 1.0+ [ 2 ].

Submitting a form using JavaScript. A dropdown list (form + select + multiple options) is processed without any submit button. Example:


<form action="action.php" method="post">

<select name="page" required="required" onchange="this.form.submit()">

<option value="" selected="selected" disabled="disabled"> --- Select a page --- </option>

<option value="http://www.kompx.com/en/os/linux-1.htm">Linux</option>

<option value="http://www.kompx.com/en/os/windows-1.htm">Windows</option>

<option value="http://www.kompx.com/en/os/dos-1.htm">DOS</option>


<noscript><input type="submit" value="Submit" /></noscript>


When an option has been chosen from the dropdown list, the form's state is changed. So the onchange event occurs and JavaScript code in onchange is executed: the process of the form submission in started by the script, not by clicking submit button which is absent.

Some server-side script [ 3 ] is meant then to handle the form action. The script is supposed to get what the form sends and have it processed. A PHP script in action.php is used in the example:


if (isset($_POST["page"])) {

    header("Location: $_POST[page]");


} else {

    echo "No options selected";


$_POST is an array of variables passed to the current script via the HTTP POST method. So $_POST[page] contains the content of the value attribute in a select option. That is, a URL. It is passed from form to PHP script and the script redirects browser to the URL / page selected.

HTML code of <noscript><input type="submit" value="Submit" /></noscript> is present in the form as a fallback in case JavaScript happens to be turned off. Then there is a submit button to appear and the form is usable anyway.

[ 1 ]

As well as Netscape 3.04+, Mozilla 0.6+.

[ 2 ]

As well as Netscape 3.04+, Mozilla 0.6+.

[ 3 ]

If a CMS is used, form action may be handled by some of its inbuilt means.

Aliosque subditos et thema


CSS centering image


CSS horizontal centering of an image. Example: HTML / XHTML. Code: <div class="example"> <img src="image.jpg" alt="Image" /> </div> CSS. Code: .example {position: relative; left: 0px; top: 0px; height: auto; width: 100%; float: left; padding: 10px; border: 1px #ccc solid; background: #fafafa;} .example img {display: block; margin: 0 auto;} CSS properties of a container (here it is example) may vary, image centering is achieved by styles applied to the image itself: .example img {display: block; margin: 0 auto;}. [ 1 ] As well as Opera 4.0+, if shorthand CSS is not used in styles. That is, if it is .example img {display: block; margin-left: auto; margin-right: auto;}. [ 2 ] As well as Netscape 6.01+, Mozilla 0.6+. [ 3 ] As well as Netscape 6.01+, Mozilla 0.6+.

Internet Explorer 3


Features : Screenshots : Download links World Wide Web service with its online experience like hypertext links, surfing, web pages as a combination of text and images / multimedia brought Internet to general public. As to general public, it all very much revolves around the web browser. The first web browser ever, WorldWideWeb (later renamed Nexus) had many of the features later to be considered as standard for web browsers, but it was an experiment, accessible and known to very few. The rest of users might expect more likely only a text-mode interface experience through a text-based web browsers like Line Mode Browser. The turning point for the World Wide Web and all Internet was the advent of Mosaic, a graphical web browser, in 1993. First for Unix and then for Apple Macintosh and Microsoft Windows. Mosaic was not the first web browser for Windows though and it could not supersede Cello, the first and initially the only web browser for Windows. Microsoft Windows was the fastest growing major platform for PC in the first half of 1990s. But Microsoft did not seem to recognize the importance of the web browser then. So the main competition under Windows at that time was among several versions of Mosaic and Cello. This competition gave birth to Netscape web browser, which became the dominant software of its kind for several years. This success and great public attention attracted by World Wide Web by 1995 made Microsoft to join in the efforts. Internet Explorer 1 was just a first experiment. Internet Explorer 2 was intended to push the Internet Explorer case - it was made available to all Windows users for free, even commercial companies. But Netscape positions were not much undermined, Internet Explorer 2 being distinctly weaker in many features is among the reasons for that. Only after the release of Internet Explorer 3.0 Microsoft browsers began to close Netscape in qualities. Internet Explorer 3 was not the first Microsoft attempt to find technical and marketing model like were Internet Explorers of 1 and 2. And it was not the first Microsoft modern web browser, the first for Microsoft to beat and surpass Netscape and all other web browser competitors like Internet Explorer 4 was. But Internet Explorer 3 still was the first in some things: the first commercial browser with Cascading Style Sheets / CSS support, the first Microsoft web browser without Spyglass source code and the first Microsoft web browser to gain a significant user share, 20-39% by the end of 1997 [ 1 ]. Still, Internet Explorer 3 was a transitional, intermediate piece of software between the early browsers and the modern ones. As to its modern state, there is an interesting detail: Internet Explorer 3 can run under 32-bit Windows 7, unlike generally the 4.0-6.0 Explorers. Features HTML (with tables and frames) support is quite strong ( More ), Internet Explorer 3 lets some HTML tricks to be used without extra strain, like "HTML table borders without CSS". CSS support in Internet Explorer 3 is weak ( More 1 ) ( More 2 ). Internet Explorer 3 also supports VBScript, ActiveX (more than 1,000 Controls), Java applets, inline multimedia, VRML and a Microsoft's reverse-engineered version of JavaScript named JScript. All of the versions and capabilities corresponding to the level of the times. Internet Explorer 3 was released for several platforms: x86(16/32 bit), 68k, PPC, MIPS, Alpha AXP. And several operating systems: Windows 3.1, Windows 95, Windows NT, System 7 / Mac OS 7, Mac OS 8.