Thursday, December 17, 2009

PopUp Window Javascript

var w = window.open(fileurlval,"_blank", "width=420,height=430,
toolbar=no,resizable=yes,scrollbars=yes,status=no");
w.focus();

Monday, May 11, 2009

Gallery Link, Slideshow

http://nicora.net/projects/photoViewer/index.cfm/demos
http://www.5bosses.com/examples/agile_carousel/multi_example/carousel.html

URL Validate

/*
function check_it() {
var theurl=document.myForm.t1.value;
var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
if (tomatch.test(theurl))
{
window.alert("URL OK.");
return true;
}
else
{
window.alert("URL invalid. Try again.");
return false;
}
}
*/

Thursday, March 12, 2009

Radio Object Javascript

This example loops through a group of radio buttons all sharing the same
name, and returns the index number of the one that's checked:



<form name="test">

<input type="radio" name="myradio" />

<input type="radio" name="myradio" checked />


<input type="radio" name="myradio" />

</form>



<script type="text/javascript">

//a variable that will hold the index number of the selected radio button

for (i=0;i<document.test.myradio.length;i++){


if (document.test.myradio[i].checked==true)

theone=i

}

</script>

Wednesday, March 11, 2009

URL Validation In Javascript

function isUrl(url)
{
var RegexUrl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
return RegexUrl.test(url);
}