Labels

Tuesday, April 22, 2014

Source code for Text Output from a Dropdown Select

<!DOCTYPE HTML>

  <html>

    <head>

    <meta charset="utf-8">

    <title>Display phone number on select</title>

  </head>


  <body>

    <label for="storeSelect">Nearest Store</label>

    <select id="nearestStore">

      <option value="noSelection">Please Select</option>

      <option value="Lowestoft">Lowestoft</option>

      <option value="GtYarmouth">Gt Yarmouth</option>

      <option value="Norwich">Norwich</option>

      <option value="Diss">Diss</option>

    </select>

    

    <div id="phoneNumber"></div>

    

    <script>

      var nearestStore = document.getElementById("nearestStore"),

          phoneNumber = document.getElementById("phoneNumber"),

          stores = {

            noSelection: "",

            Lowestoft: "12345678",

            GtYarmouth: "222 444 666",

            Norwich: "999 999 999",

            Diss: "0000000000000"

          }

          

      nearestStore.onchange = function(){

        phoneNumber.innerHTML = stores[this.value];

      }

    </script>

  </body>

</html>

Friday, April 18, 2014

Tomcat modification steps to work perl scripts from web applications

Steps to change
1) Uncomment the CGIServlet from web.xml file under TOMCAT_HOME/CONF folder that's commented by default .



2) Uncomment mapping for the CGI Gateway servlet from web.xml file under TOMCAT_HOME/CONF folder that's commented by default







3) Add the priviliged ="true" in context.xml file under TOMCAT_HOME/CONF folder.




4) Create a cgi folder under  webapps/ROOT/WEB-INF for place CGI(perl) scripts in cgi folder .

5) Restart the Tomcat server to Pick up the new configuration


6) access the url http:// serverip:8080/cgi-bin/xxxx.pl