表单控件JS文件二
function getSeleIndex(field_name) {
for ( i = 0; i < field_name.options.length; i++ ) {
if ( field_name.options[i].selected ) {
return i;
break;
}
}
}
function getRBValue(field_text) {
var form = document.all;
for (var i = 0; i < form.elements.length; i++) {
if (form.elements[i].type == "radio") {
if (form.elements[i].name == field_text) {
if(form.elements[i].checked) {
return form.elements[i].value;
break;
}
}
}
}
}
function setRBSele(field_text,s) {
var form = document.all;
for (var i = 0; i < form.elements.length; i++) {
if (form.elements[i].type == "radio") {
if (form.elements[i].name == field_text) {
if(form.elements[i].value == s) {
form.elements[i].checked = true;
break;
}
}
}
} //End for
}
function HideLayers(field_text) {
if (document.all.item(field_text)=="[object]") {
document.all.item(field_text).style.display = "none";
document.all.item(field_text).style.visibility='hidden';
}
}
function ShowLayers(field_text) {
if (document.all.item(field_text)=="[object]") {
document.all.item(field_text).style.display = "block";
document.all.item(field_text).style.visibility='visible';
}
}
function eventfalse()
{
window.event.returnValue=false;
}
function WriteCookie(name,value) {
var expires = new Date();
document.cookie = name + "=" + escape(value)
}
function WriteCookieWithDate(name,value) {
var expires = new Date();
expires.setTime(expires.getTime()+24*60*60*365*1000);
document.cookie = name + "=" + escape(value) + ";expires=" + expires.toGMTString();
}