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


Web browsers for DOS


Arachne : Dillo : DOSLYNX : Lynx : Links : ELinks Web browsers for DOS may be looked at as existing roughly in two categories. Web browsers which can be installed without excessive efforts + work stably within their capability. And the rest of the web browsers of functionality more or less limited or problematic. The major web browsers for DOS include applications with GUI and text-based browsers. The graphical web browsers for DOS are several versions of Arachne - GPL version, Arachne Labs version, Ray Andrews version - and Dillo. As well as DR-WebSpyder based on Arachne and WebSpyder's variation - Lineo Embrowser. Text-based web browsers for DOS are a little bit more numerous: DOSLYNX, lynx, links, elinks. The graphical web browsers for DOS even if being prominent among DOS web browsers for their capabilities are definitely inferior in comparison with major web browsers for Windows, Linux or Mac OS X due to the restrictions of the DOS nature, small user and developer base, some other reasons.

Lynx browser. Creating sitemap.xml


There are more than few online services for sitemap.xml generation. But it is also possible to do it yourself, by means of lynx web browser and several Linux command line utilities. An example bash script employing them, named "sitemap.sh" is described below. Bash script creating a sitemap.xml file: #!/bin/bash cd /home/me/sitemap/www/ lynx -crawl -traversal -accept_all_cookies -connect_timeout=30 http://www.compmiscellanea.com/ > /dev/null cd /home/me/sitemap/www2/ lynx -crawl -traversal -accept_all_cookies -connect_timeout=30 http://compmiscellanea.com/ > /dev/null cat /home/me/sitemap/www2/traverse.dat >> /home/me/sitemap/www/traverse.dat cat /home/me/sitemap/www/traverse.dat | sed -e 's/\<www\>\.//g' | sort | uniq > /home/me/sitemap/sitemap/sitemap.xml sed -i 's/\&/\&amp\;/g' /home/me/sitemap/sitemap/sitemap.xml sed -i "s/'/\&apos\;/g" /home/me/sitemap/sitemap/sitemap.xml sed -i 's/"/\&quot\;/g' /home/me/sitemap/sitemap/sitemap.xml sed -i 's/>/\&gt\;/g' /home/me/sitemap/sitemap/sitemap.xml sed -i 's/</\&lt\;/g' /home/me/sitemap/sitemap/sitemap.xml sed -i 's/http:\/\//http:\/\/www\./g' /home/me/sitemap/sitemap/sitemap.xml sed -i -e 's/^/<url><loc>/' /home/me/sitemap/sitemap/sitemap.xml sed -i -e 's/$/<\/loc><\/url>/' /home/me/sitemap/sitemap/sitemap.xml sed -i -e '1 i <?xml version="1\.0" encoding="UTF-8"?>\r\r<urlset xmlns="http:\/\/www\.sitemaps\.org\/schemas\/sitemap\/0\.9" xmlns:xsi="http:\/\/www\.w3\.org\/2001\/XMLSchema-instance" xsi:schemaLocation="http:\/\/www\.sitemaps\.org\/schemas\/sitemap\/0\.9 http:\/\/www\.sitemaps\.org\/schemas\/sitemap\/0\.9\/sitemap\.xsd">\r\r<!-- created by sitemap.sh from http:\/\/www.compmiscellanea.com\/en\/lynx-browser-creating-sitemap.xml\.htm -->\r\r' /home/me/sitemap/sitemap/sitemap.xml sed -i -e '$ a \\r</urlset>' /home/me/sitemap/sitemap/sitemap.xml sed -i '/static/d' /home/me/sitemap/sitemap/sitemap.xml echo "...Done" After the bash script file is prepared: "chmod +x sitemap.sh" to make it executable. Download sitemap.sh in sitemap.sh.tar.gz archive ( After downloading and unpacking it, put a web site name with "www" instead of http://www.compmiscellanea.com/ and a web site name without "www" instead of http://compmiscellanea.com/ in the file. Replace "static" in the last line of the file by a string unnecessary links should possess to be removed. Then "chmod +x sitemap.sh". Then run sitemap.sh ). Commentary Download sitemap2.sh with line by line commentary in sitemap2.sh.tar.gz archive. Before running the bash script, three folders should be created. Since lynx browser may miss some links if a web site domain name to be crawled is put with or without "www", bash script runs lynx twice, crawling the web site by its name with "www" and crawling the web site by its name without "www". The two result files are put into two of these separate folders, here they are "/home/me/sitemap/www/" and "/home/me/sitemap/www2/". And "/home/me/sitemap/sitemap/" is for sitemap.xml created in the end. 1. Path to bash: #!/bin/bash 2. Going to a folder - lynx browser is going to put there the files obtained from crawling a web site with "www" in its name: cd /home/me/sitemap/www/ 3. Running lynx browser to crawl a web site.