473,727 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enforcing Validation based on Drop-Down choice

Hi -

I am trying to figure out a way to enforce the validation included for
this form based on whether the user chooses "email" or "phone" as the
contact choice. Right now it is set to enforce validation on both.
Is there a way to link the drop-down choice to the correspondent
validation section while disabling validation for the other one?

here's what I presently have:

<html>

<head>
<title>Contac t Form</title>
<link rel="stylesheet " type="text/css" href="/end.css" />
<script language="JavaS cript1.2">

//Disable select-text script (IE4+, NS6+)

function disableselect(e ){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onsele ctstart=new Function ("return false")

//if NS6
if (window.sidebar ){
document.onmous edown=disablese lect
document.onclic k=reEnable
}
</script>
<script language="JavaS cript">
<!--

/*************** *************** *************** **
* Required field(s) validation
*************** *************** *************** **/

function formCheck(formo bj){
// Enter name of mandatory fields
var fieldRequired = Array("txtname" , "txtemail", "txtphone",
"txtcountry ");
// Enter field description to appear in the dialog box
var fieldDescriptio n = Array("Full Name", "E-mail", "Phone Number",
"Country");
// dialog message
var alertMsg = "Please complete the following fields:\n";

var l_Msg = alertMsg.length ;

for (var i = 0; i < fieldRequired.l ength; i++){
var obj = formobj.element s[fieldRequired[i]];
if (obj){
switch(obj.type ){
case "select-one":
if (obj.selectedIn dex == -1 || obj.options[obj.selectedInd ex].text
== ""){
alertMsg += " - " + fieldDescriptio n[i] + "\n";
}
break;
case "select-multiple":
if (obj.selectedIn dex == -1){
alertMsg += " - " + fieldDescriptio n[i] + "\n";
}
break;
case "text":
case "textarea":
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescriptio n[i] + "\n";
}
break;
default:
}
if (obj.type == undefined){
var blnchecked = false;
for (var j = 0; j < obj.length; j++){
if (obj[j].checked){
blnchecked = true;
}
}
if (!blnchecked){
alertMsg += " - " + fieldDescriptio n[i] + "\n";
}
}
}
}

if (alertMsg.lengt h == l_Msg){
return true;
}else{
alert(alertMsg) ;
return false;
}
}
// -->
</script>

<script type="text/javascript">

/*************** *************** *************** **
* Disable "Enter" key in Form script
*************** *************** *************** **/

function handleEnter (field, event) {
var keyCode = event.keyCode ? event.keyCode : event.which ?
event.which : event.charCode;
if (keyCode == 13) {
var i;
for (i = 0; i < field.form.elem ents.length; i++)
if (field == field.form.elem ents[i])
break;
i = (i + 1) % field.form.elem ents.length;
field.form.elem ents[i].focus();
return false;
}
else
return true;
}

</script>

<script language = "Javascript ">
/**
* DHTML phone number validation script.
*/

// Declaring required variables
var digits = "0123456789 ";
// non-digit characters which are allowed in phone numbers
var phoneNumberDeli miters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhone Chars = phoneNumberDeli miters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPho neNumber = 10;

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function stripCharsInBag (s, bag)
{ var i;
var returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++)
{
// Check that current character isn't whitespace.
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}

function checkInternatio nalPhone(strPho ne){
s=stripCharsInB ag(strPhone,val idWorldPhoneCha rs);
return (isInteger(s) && s.length >= minDigitsInIPho neNumber);
}

function Validatephone() {
var Phone=document. contact.txtphon e

if ((Phone.value== null)||(Phone.v alue=="")){
alert("Please Enter your Phone Number")
Phone.focus()
return false
}
if (checkInternati onalPhone(Phone .value)==false) {
alert("Please Enter a Valid Phone Number")
Phone.value=""
Phone.focus()
return false
}
return true
}
</script>

<script language = "Javascript ">
/**
* DHTML email validation script.
*/

function echeck(str) {

var at="@"
var dot="."
var lat=str.indexOf (at)
var lstr=str.length
var ldot=str.indexO f(dot)
if (str.indexOf(at )==-1){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(at )==-1 || str.indexOf(at) ==0 ||
str.indexOf(at) ==lstr){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(do t)==-1 || str.indexOf(dot )==0 ||
str.indexOf(dot )==lstr){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(at ,(lat+1))!=-1){
alert("You have entered an invalid E-mail address")
return false
}

if (str.substring( lat-1,lat)==dot ||
str.substring(l at+1,lat+2)==do t){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(do t,(lat+2))==-1){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(" ")!=-1){
alert("You have entered an invalid E-mail address")
return false
}

return true
}

function Validateemail() {
var emailID=documen t.contact.txtem ail

if (echeck(emailID .value)==false) {
emailID.value=" "
emailID.focus()
return false
}
return true
}
</script>

<script language = "Javascript ">
/**
* DHTML textbox character counter (IE4+) script.
*/

function taLimit() {
var taObj=event.src Element;
if (taObj.value.le ngth==taObj.max Length*1) return false;
}

function taCount(visCnt) {
var taObj=event.src Element;
if (taObj.value.le ngth>taObj.maxL ength*1)
taObj.value=taO bj.value.substr ing(0,taObj.max Length*1);
if (visCnt) visCnt.innerTex t=taObj.maxLeng th-taObj.value.len gth;
}
</script>

<style type="text/css">

..input {
background-color: #DEDEDE;
border: 1px solid;
border-top-color: #888888;
border-left-color: #888888;
border-right-color: #FFFFFF;
border-bottom-color: #FFFFFF;
color: #1D2A40;
font-family: Verdana;
}
..input2 {
background-color: #DEDEDE;
border: 1px solid;
border-top-color: #888888;
border-left-color: #888888;
border-right-color: #FFFFFF;
border-bottom-color: #FFFFFF;
color: #1D2A40;
font-family: Verdana;
}
body {
scrollbar-face-color: #2E343F;
scrollbar-shadow-color: #ACB2BC;
scrollbar-highlight-color: #ACB2BC;
scrollbar-3dlight-color: #000000;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #303642;
scrollbar-arrow-color: #ACB2BC;
}
</style>
</head>

<body bgcolor="#FFFFF F" body onload="" scroll="no"
style="overflow :hidden"><form id="contact" name="contact"
method="POST" action="/Scripts/submit.asp" onsubmit="retur n
formCheck(this) ;">

<script language=JavaSc ript>
<!--

//Disable right click script

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);retu rn false;}}
function clickNS(e) {if
(document.layer s||(document.ge tElementById&&! document.all)) {
if (e.which==2||e. which==3) {(message);retu rn false;}}}
if (document.layer s)
{document.captu reEvents(Event. MOUSEDOWN);docu ment.onmousedow n=clickNS;}
else{document.o nmouseup=clickN S;document.onco ntextmenu=click IE;}

document.oncont extmenu=new Function("retur n false")
// -->
</script>

<p align="center"> <font size="6" face="Arial, Helvetica,
sans-serif"><b><br>
<br>
</b></font></p>
<table width="64%" border="1" cellspacing="0" cellpadding="5"
align="center" bordercolor="#0 03366">
<tr>
<td nowrap><font size="6" face="Arial, Helvetica,
sans-serif"><font color="05394F"> <b>Contact
Form</b></font><b><font
color="#FFFFFF" >-------------------------</font><img src="logo.jpg"
width="131" height="47"></b></font></td>
</tr>
</table>
<div align="center">

<table border="0" cellpadding="0" style="border-collapse: collapse;
border: 1px outset #000000; background-color: #053951" width="64%"
id="table1" cellspacing="10 ">
<tr>
<td width="145" height="46"><b> <br>
&nbsp;<font face="Arial, Helvetica, sans-serif"
color="#FFFFFF" >Name:</font></b></td>
<td height="46" nowrap><br>
<input type="text" name="txtname" size="20" maxlength="50"
class="input" style="border: 1px outset #000000" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; ">
<font color="#FFFFFF" size="1"><font face="Arial, Helvetica,
sans-serif">(Press
ENTER to move between fields)</font></font> </td>
</tr>
<tr>
<td width="145" nowrap height="27"><b> <font face="Arial,
Helvetica, sans-serif" color="#FFFFFF" >&nbsp;Email
Address:</font></b></td>
<td height="27" nowrap>
<input type="text" name="txtemail" size="20" maxlength="50"
class="input" style="border: 1px outset #000000" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; " onChange="retur n
Validateemail() ">
</td>
</tr>
<tr>
<td width="145" nowrap><b>&nbsp ;<font face="Arial, Helvetica,
sans-serif" color="#FFFFFF" >Phone
Number:</font></b></td>
<td nowrap> <font color="#FFFFFF" >
<input type="text" name="txtphone" size="20" maxlength="50"
class="input" style="border: 1px outset #000000" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; " onChange="retur n
Validatephone() ">
<font face="Arial, Helvetica, sans-serif" size="2"> <font
size="1">(Inclu de
area/country code)</font></font></font></td>
</tr>
<tr>
<td width="145" nowrap><b><font color="#FFFFFF" >&nbsp;<font
face="Arial, Helvetica, sans-serif">Contact
me via:</font></font></b></td>
<td width="380" nowrap>
<select name="contact" class="input" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; ">
<option selected>E-Mail</option>
<option>Phone </option>
</select>
</td>
</tr>
<tr>
<td width="145" align="left" valign="top" nowrap><b><font
face="Arial, Helvetica, sans-serif"
color="#FFFFFF" >&nbsp;Country: </font></b></td>
<td>
<input type="text" name="txtcountr y" size="20" maxlength="30"
class="input" style="border: 1px outset #000000" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; ">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td width="145" align="left" valign="top" nowrap
height="300"><b >&nbsp;<font face="Arial, Helvetica, sans-serif"
size="3" color="#FFFFFF" >Question(s): </font></b></td>
<td height="213"> <p>
<textarea onkeypress="ret urn taLimit()" onkeyup="return
taCount(myCount er)" rows="8" name="txtcommen ts" cols="39"
maxLength="255" class="input2"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; "></textarea>
<font color="#FFFFFF" size="1" face="Arial, Helvetica,
sans-serif"><br>
</font> <font color="#FFFFFF" size="1" face="Arial,
Helvetica, sans-serif">You
have <B><SPAN id=myCounter>25 5</SPAN></B> characters
remaining for
your comments</font></p>
<p>
<input type="submit" value="Submit Form" class=large2
name="B1" style="border: 1px outset #000000; background-color:
#F2F2F2">
<input type="reset" value="Clear Fields" class=large2
name="B2" style="border: 1px outset #000000; background-color:
#F2F2F2">
</p>
<td width="91" height="22">
</table>
</div>
</form>
<script type="text/javascript"><!--
document.contac t.txtname.focus ();
//--></script>
</body>

</html>
Jul 23 '05 #1
5 2609
EviL KerneL wrote:
Hi -

I am trying to figure out a way to enforce the validation included for
this form based on whether the user chooses "email" or "phone" as the
contact choice. Right now it is set to enforce validation on both.
Is there a way to link the drop-down choice to the correspondent
validation section while disabling validation for the other one?

here's what I presently have:

<html>

<head>
<title>Contac t Form</title>
<link rel="stylesheet " type="text/css" href="/end.css" />
<script language="JavaS cript1.2">

//Disable select-text script (IE4+, NS6+)

function disableselect(e ){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onsele ctstart=new Function ("return false")

//if NS6
if (window.sidebar ){
document.onmous edown=disablese lect
document.onclic k=reEnable
}
</script>
<script language="JavaS cript">
<!--

/*************** *************** *************** **
* Required field(s) validation
*************** *************** *************** **/

function formCheck(formo bj){
// Enter name of mandatory fields
var fieldRequired = Array("txtname" , "txtemail", "txtphone",
"txtcountry ");
// Enter field description to appear in the dialog box
var fieldDescriptio n = Array("Full Name", "E-mail", "Phone Number",
"Country");
// dialog message
var alertMsg = "Please complete the following fields:\n";

var l_Msg = alertMsg.length ;

for (var i = 0; i < fieldRequired.l ength; i++){
var obj = formobj.element s[fieldRequired[i]];
if (obj){
switch(obj.type ){
case "select-one":
if (obj.selectedIn dex == -1 || obj.options[obj.selectedInd ex].text
== ""){
alertMsg += " - " + fieldDescriptio n[i] + "\n";
}
break;
case "select-multiple":
if (obj.selectedIn dex == -1){
alertMsg += " - " + fieldDescriptio n[i] + "\n";
}
break;
case "text":
case "textarea":
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescriptio n[i] + "\n";
}
break;
default:
}
if (obj.type == undefined){
var blnchecked = false;
for (var j = 0; j < obj.length; j++){
if (obj[j].checked){
blnchecked = true;
}
}
if (!blnchecked){
alertMsg += " - " + fieldDescriptio n[i] + "\n";
}
}
}
}

if (alertMsg.lengt h == l_Msg){
return true;
}else{
alert(alertMsg) ;
return false;
}
}
// -->
</script>

<script type="text/javascript">

/*************** *************** *************** **
* Disable "Enter" key in Form script
*************** *************** *************** **/

function handleEnter (field, event) {
var keyCode = event.keyCode ? event.keyCode : event.which ?
event.which : event.charCode;
if (keyCode == 13) {
var i;
for (i = 0; i < field.form.elem ents.length; i++)
if (field == field.form.elem ents[i])
break;
i = (i + 1) % field.form.elem ents.length;
field.form.elem ents[i].focus();
return false;
}
else
return true;
}

</script>

<script language = "Javascript ">
/**
* DHTML phone number validation script.
*/

// Declaring required variables
var digits = "0123456789 ";
// non-digit characters which are allowed in phone numbers
var phoneNumberDeli miters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhone Chars = phoneNumberDeli miters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPho neNumber = 10;

function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function stripCharsInBag (s, bag)
{ var i;
var returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++)
{
// Check that current character isn't whitespace.
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}

function checkInternatio nalPhone(strPho ne){
s=stripCharsInB ag(strPhone,val idWorldPhoneCha rs);
return (isInteger(s) && s.length >= minDigitsInIPho neNumber);
}

function Validatephone() {
var Phone=document. contact.txtphon e

if ((Phone.value== null)||(Phone.v alue=="")){
alert("Please Enter your Phone Number")
Phone.focus()
return false
}
if (checkInternati onalPhone(Phone .value)==false) {
alert("Please Enter a Valid Phone Number")
Phone.value=""
Phone.focus()
return false
}
return true
}
</script>

<script language = "Javascript ">
/**
* DHTML email validation script.
*/

function echeck(str) {

var at="@"
var dot="."
var lat=str.indexOf (at)
var lstr=str.length
var ldot=str.indexO f(dot)
if (str.indexOf(at )==-1){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(at )==-1 || str.indexOf(at) ==0 ||
str.indexOf(at) ==lstr){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(do t)==-1 || str.indexOf(dot )==0 ||
str.indexOf(dot )==lstr){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(at ,(lat+1))!=-1){
alert("You have entered an invalid E-mail address")
return false
}

if (str.substring( lat-1,lat)==dot ||
str.substring(l at+1,lat+2)==do t){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(do t,(lat+2))==-1){
alert("You have entered an invalid E-mail address")
return false
}

if (str.indexOf(" ")!=-1){
alert("You have entered an invalid E-mail address")
return false
}

return true
}

function Validateemail() {
var emailID=documen t.contact.txtem ail

if (echeck(emailID .value)==false) {
emailID.value=" "
emailID.focus()
return false
}
return true
}
</script>

<script language = "Javascript ">
/**
* DHTML textbox character counter (IE4+) script.
*/

function taLimit() {
var taObj=event.src Element;
if (taObj.value.le ngth==taObj.max Length*1) return false;
}

function taCount(visCnt) {
var taObj=event.src Element;
if (taObj.value.le ngth>taObj.maxL ength*1)
taObj.value=taO bj.value.substr ing(0,taObj.max Length*1);
if (visCnt) visCnt.innerTex t=taObj.maxLeng th-taObj.value.len gth;
}
</script>

<style type="text/css">

.input {
background-color: #DEDEDE;
border: 1px solid;
border-top-color: #888888;
border-left-color: #888888;
border-right-color: #FFFFFF;
border-bottom-color: #FFFFFF;
color: #1D2A40;
font-family: Verdana;
}
.input2 {
background-color: #DEDEDE;
border: 1px solid;
border-top-color: #888888;
border-left-color: #888888;
border-right-color: #FFFFFF;
border-bottom-color: #FFFFFF;
color: #1D2A40;
font-family: Verdana;
}
body {
scrollbar-face-color: #2E343F;
scrollbar-shadow-color: #ACB2BC;
scrollbar-highlight-color: #ACB2BC;
scrollbar-3dlight-color: #000000;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #303642;
scrollbar-arrow-color: #ACB2BC;
}
</style>
</head>

<body bgcolor="#FFFFF F" body onload="" scroll="no"
style="overflow :hidden"><form id="contact" name="contact"
method="POST" action="/Scripts/submit.asp" onsubmit="retur n
formCheck(this) ;">

<script language=JavaSc ript>
<!--

//Disable right click script

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);retu rn false;}}
function clickNS(e) {if
(document.layer s||(document.ge tElementById&&! document.all)) {
if (e.which==2||e. which==3) {(message);retu rn false;}}}
if (document.layer s)
{document.captu reEvents(Event. MOUSEDOWN);docu ment.onmousedow n=clickNS;}
else{document.o nmouseup=clickN S;document.onco ntextmenu=click IE;}

document.oncont extmenu=new Function("retur n false")
// -->
</script>

<p align="center"> <font size="6" face="Arial, Helvetica,
sans-serif"><b><br>
<br>
</b></font></p>
<table width="64%" border="1" cellspacing="0" cellpadding="5"
align="center" bordercolor="#0 03366">
<tr>
<td nowrap><font size="6" face="Arial, Helvetica,
sans-serif"><font color="05394F"> <b>Contact
Form</b></font><b><font
color="#FFFFFF" >-------------------------</font><img src="logo.jpg"
width="131" height="47"></b></font></td>
</tr>
</table>
<div align="center">

<table border="0" cellpadding="0" style="border-collapse: collapse;
border: 1px outset #000000; background-color: #053951" width="64%"
id="table1" cellspacing="10 ">
<tr>
<td width="145" height="46"><b> <br>
&nbsp;<font face="Arial, Helvetica, sans-serif"
color="#FFFFFF" >Name:</font></b></td>
<td height="46" nowrap><br>
<input type="text" name="txtname" size="20" maxlength="50"
class="input" style="border: 1px outset #000000" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; ">
<font color="#FFFFFF" size="1"><font face="Arial, Helvetica,
sans-serif">(Press
ENTER to move between fields)</font></font> </td>
</tr>
<tr>
<td width="145" nowrap height="27"><b> <font face="Arial,
Helvetica, sans-serif" color="#FFFFFF" >&nbsp;Email
Address:</font></b></td>
<td height="27" nowrap>
<input type="text" name="txtemail" size="20" maxlength="50"
class="input" style="border: 1px outset #000000" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; " onChange="retur n
Validateemail() ">
</td>
</tr>
<tr>
<td width="145" nowrap><b>&nbsp ;<font face="Arial, Helvetica,
sans-serif" color="#FFFFFF" >Phone
Number:</font></b></td>
<td nowrap> <font color="#FFFFFF" >
<input type="text" name="txtphone" size="20" maxlength="50"
class="input" style="border: 1px outset #000000" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; " onChange="retur n
Validatephone() ">
<font face="Arial, Helvetica, sans-serif" size="2"> <font
size="1">(Inclu de
area/country code)</font></font></font></td>
</tr>
<tr>
<td width="145" nowrap><b><font color="#FFFFFF" >&nbsp;<font
face="Arial, Helvetica, sans-serif">Contact
me via:</font></font></b></td>
<td width="380" nowrap>
<select name="contact" class="input" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; ">
<option selected>E-Mail</option>
<option>Phone </option>
</select>
</td>
</tr>
<tr>
<td width="145" align="left" valign="top" nowrap><b><font
face="Arial, Helvetica, sans-serif"
color="#FFFFFF" >&nbsp;Country: </font></b></td>
<td>
<input type="text" name="txtcountr y" size="20" maxlength="30"
class="input" style="border: 1px outset #000000" onkeypress="ret urn
handleEnter(thi s, event)"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; ">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td width="145" align="left" valign="top" nowrap
height="300"><b >&nbsp;<font face="Arial, Helvetica, sans-serif"
size="3" color="#FFFFFF" >Question(s): </font></b></td>
<td height="213"> <p>
<textarea onkeypress="ret urn taLimit()" onkeyup="return
taCount(myCount er)" rows="8" name="txtcommen ts" cols="39"
maxLength="255" class="input2"
onfocus="this.s tyle.background Color='#66FFFF' ;"
onblur="this.st yle.backgroundC olor='#DEDEDE'; "></textarea>
<font color="#FFFFFF" size="1" face="Arial, Helvetica,
sans-serif"><br>
</font> <font color="#FFFFFF" size="1" face="Arial,
Helvetica, sans-serif">You
have <B><SPAN id=myCounter>25 5</SPAN></B> characters
remaining for
your comments</font></p>
<p>
<input type="submit" value="Submit Form" class=large2
name="B1" style="border: 1px outset #000000; background-color:
#F2F2F2">
<input type="reset" value="Clear Fields" class=large2
name="B2" style="border: 1px outset #000000; background-color:
#F2F2F2">
</p>
<td width="91" height="22">
</table>
</div>
</form>
<script type="text/javascript"><!--
document.contac t.txtname.focus ();
//--></script>
</body>

</html>

For a mutually exclusive choice, why not use a radio button group instead?
Mick
Jul 23 '05 #2
JRS: In article <%B************ *******@twister .nyroc.rr.com>, seen in
news:comp.lang. javascript, Mick White <mw******@BOGUS rochester.rr.co m>
posted at Mon, 7 Jun 2004 14:04:43 :
Lines: 460
... ... ... ...

For a mutually exclusive choice, why not use a radio button group instead?
Mick


See FAQ, sec 2.3, para 6, first injunction.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #3
Dr John Stockton wrote:
JRS: In article <%B************ *******@twister .nyroc.rr.com>, seen in
news:comp.lang. javascript, Mick White <mw******@BOGUS rochester.rr.co m>
posted at Mon, 7 Jun 2004 14:04:43 :

Lines: 460
... ... ... ...


For a mutually exclusive choice, why not use a radio button group instead?
Mick

See FAQ, sec 2.3, para 6, first injunction.


And your point?
Mick

Jul 23 '05 #4
Mick White wrote:
Dr John Stockton wrote:
Mick White wrote: <snip>
For a mutually exclusive choice, why not use a radio
button group instead?
Mick


See FAQ, sec 2.3, para 6, first injunction.


And your point?


14KB post containing only 14 additional words, all of which appeared to
be directly in response to the first paragraph of the original post.
Trimming out quoted material that is not being directly commented upon
is normal practice and reduces bandwidth and storage requirements for
everyone using the group (and all the news servers carrying it). And it
also reduces the need to scroll through masses of text and code looking
for comments that are not there.

Richard.
Jul 23 '05 #5
Richard Cornford wrote:
Mick White wrote:
<snip>
For a mutually exclusive choice, why not use a radio
button group instead?
Mick

See FAQ, sec 2.3, para 6, first injunction.


And your point?

14KB post containing only 14 additional words, <snip>


I ask Tweedledee, and Tweedledum answers.
But point is taken,
Mick

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3845
by: Geoff Soper | last post by:
I've been looking for a simple way of checking that a string is an e-mail address. I don't need to check if the address exists, just if the format of the string matches. There seem to be lots of different methods, can someone suggest which is the best, with justification. I'm not looking for total accuracy, I'd much rather let a few false positives through than get any false negatives. Many thanks
3
1603
by: Xamle Eng | last post by:
I am looking for a data oriented schema-enforcing XML editor. By schema-enforcing I mean an editor that doesn't just have a button to verify the schema - I want an editor that actively enforces it and makes it difficult or impossible to generate data not conforming to the schema. I have downloaded many XML editors, both free/open-source and evaluation copies of commercial software but so far none of them fits my requirements. Many of...
2
2252
by: Frosty | last post by:
Howto make datagrid enforce rules of xml schema? Created xml schema in the designer. Constraints created there using the following <xs:simpleType name="zipcode"><xs:restriction base="xs:string"><xs:pattern value="\d{5}" /></xs:restriction></xs:simpleType Datagrid does not enforce this rule, even though dataGrid1_Validating() is called. dataset.WriteXml() saves withouth any warning, but
6
3705
by: Nedu N | last post by:
Hi, I want to have confirmation(Yes/No) on a button of the webform in which there are many validation controls. I want all the validation controls to be triggered first and then Yes/No confirmation message. By adding just an confirm attribute for 'onclick' event of the button doesn't work with validation controls. Is there any short way to go around this. Thanks Nedu
5
2416
by: M | last post by:
Hi, it's possible to append a custom action to a client-side verification of a validation control ? I have a validator summary control that shows (automatically) a message box if the validation of the validators in the page fails; after the user close this message box I have to perform a client-side function (hiding some text) ... it's possible? Thanks!
5
2819
by: Richard Brown | last post by:
Ok, I've been looking through the .NET SDK docs and stuff. I'm wondering if you can provide a control extender that does generic validation or functionality just by dropping it on the form. For instance, using the IExtenderProvider interface, you can specify properties, but there is nothing documented about linking into a control's events. For instance, in my application, there are specific formatting, functionality and validation for...
2
6710
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the textbox from the Validating event. Now put the focus back on the textbox click the button bar button. Nothing happens. The form causes validation is true, so is the button bar and the control.
1
1725
by: Thelma Lubkin | last post by:
I have a form w/ 11 identical text boxes in each of which user can enter a number between 1 and 11. Each defaults to 0, which I use to flag empty. Each has the 1 to 11 restriction as its validation rule, but I also need to enforce no duplicates among them. I haven't been able to figure out how to do this in the validation rule, so I have a function that gets as a parameter a number to identify which textbox is calling it that handles that...
12
2266
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation errors show up in your error-list, you can disable this functionality by selecting the Tools->Options menu item in VS or Visual Web Developer. Select the TextEditor->Html->Validation tree option in the left-hand side of the
9
4177
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be honest I usually hire someone to do it for me, grab predone scripts and kind of hack out the parts that I need, or just do very minimal validation (e.g. this is numeric, this is alpha-numeric, etc.)
0
8890
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8101
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.