Javascript Category

reload windows for once

In: Javascript

var reloaded = false;
var loc=”"+document.location;
loc = loc.indexOf(”?reloaded=”)!=-1?loc.substring(loc.indexOf(”?reloaded=”)+10,loc.length):”";
loc = loc.indexOf(”&”)!=-1?loc.substring(0,loc.indexOf(”&”)):loc;
reloaded = loc!=”"?(loc==”true”):reloaded;
function reloadOnceOnly() {
if (!reloaded)
window.location.replace(window.location+”?reloaded=true&cPath=2_25″);
}
reloadOnceOnly();

elated.com

In: website

http://www.elated.com/articles/form-validation-with-javascript/

felgal.com

In: website

http://www.felgall.com/net3c.htm

radio button

In: Validation

function valbutton(thisform) {
// place any other field validations that you require here
// validate myradiobuttons
myOption = -1;
for (i=thisform.myradiobutton.length-1; i > -1; i–) {
if (thisform.myradiobutton[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert(”You must select a radio button”);
return false;
}
alert(”You selected button number ” + myOption
+ ” which has a value of ”
+ thisform.myradiobutton[myOption].value);
// place any [...]

toggle

In: onclick

function toggle(targetId) {
target = document.getElementById(targetId);
if (targetId == “raddress1″) {
raddress.style.display = “none”;
}
if (targetId == “raddress2″) {
raddress.style.display = “”;
}
[...]