This little javascript function will let you show/hide elements on a form.
function showorhide(id) {
if(document.getElementById(id)){
var ele = document.getElementById(id);
if(ele.style.display==”none”){ ele.style.display=”block”; }else{ ele.style.display=”none”; [...]
How can I check in javascript if the text box control exists? Here is a simple code to check that:
var control = document.formname.elements["txt"];
var isControl = typeof control == “object”
alert(isControl);
Let’s say you need to replace coma (, ) to a dot (.)
Here is easiest way to do that:
test=test.split((”,”)).join(”.”);
Use this simple javascript example to get value from list box:
<script language=”javascript”>
function test() {
var form = document.forms[0];
for (i=0; i < form.elements.length; i ++) {
if (form.elemenets[i].tagname == “select”)
alert(”Selected option: ” + form.elements[i].options.name);
}
}
</script>
This question was asked a lot: “How do I refresh main window and come back to main window using Javascript?”
Here is a loution:
opener.location.href=opener.location.href;
opener.close();
Adding the “bookmark this page” javascript below will help to encourage return visits. Your visitor simply clicks on the link and a popup prompt will appear so they can add your site to their favorites list.
Step 1
First you place the following in your tag of your html
Change the 4th and 5th lines “var url Address [...]
<script>
var today=new Date()
document.write(’<center>’+today.toString()+’<br>’+window.location+’</center>’)
</script>

