Page 1 of 1

*PHP Form -Radio button validation*

Posted: Sun Jul 03, 2005 7:21 pm
by athemiya
Hi all :D ,

Newbie here and same goes for PHP too. Here is my problem:

I have a form in a HTML page that currently does not allow a user to submit the form unless the 'Name' and 'Email' variables are typed in. But I also want to add some further code in that requests the user to select a Single/Double/Double Deluxe or Any choice of room type.

My PHP page (ProcessContact.php) is working fine, but its the HTML form that will need me to add in the code around here:

Code: Select all

form name="form1" method="post" action="ProcessContact.php" id="form1" onSubmit="YY_checkform('form1','ContactEmail[0]','#q','2','Field \'ContactEmail[0]\' is not valid.','Name','#q','0','Field \'Name\' is not valid.','EMail','#S','2','Field \'EMail\' is not valid.');return document.MM_returnValue">
At the moment, it works perfectly if the user doesnt add in their Name or Email, the form will not submit, and an alert comes up -I want to include the radio buttons too. The form has been re-hashed from another form, which is not good -and I am finding that when a user enters some fields on the form and not others, that the email being sent to the inbox after a user submits the form is missing KEY information. I have attached the code of the PHP page here also for viewing...

Code: Select all

<? 
 
$message = "";
 do {
 if (($HTTP_POST_VARS[key($HTTP_POST_VARS)] != "") &&(key($HTTP_POST_VARS) != "ContactEmail")&&(key($HTTP_POST_VARS) != "submit")) {
 $message .= key($HTTP_POST_VARS) . ": " . $HTTP_POST_VARS[key($HTTP_POST_VARS)] . "\n";
 }
 } while(next($HTTP_POST_VARS));
 
 mail($HTTP_POST_VARS["ContactEmail"],"Booking request - from website",$message);
echo ("<script language='javascript'>document.location='thankyou.html'</script>");
?>
I have looked extensively around the net for tutorials on YY_Checkforms and how to add in extra code in order to make sure the user clicks at least ONE of the radio buttons on the page to no luck. The radio buttons are as follows (further down in the code of course):

Code: Select all

<input name="Beds-single" type="radio" id="Beds1" value="single">
<input name="Beds-double" type="radio" id="Beds2" value="double">
<input name="Beds-deluxe" type="radio" id="Beds3" value="single">
<input name="Beds-any" type="radio" id="Beds4" value="any">
The full code of the HTML page with the form in is as follows too: (making sure I get all the info I need to show people my problem!)

Code: Select all

<html>
<head>
<title>Welcome to Hotel82London - One of London's great boutique hotels</title>
<META NAME="TITLE" CONTENT="Welcome to Hotel82London - One of London's great boutique hotels"> 
<meta name="description" content="Hotel82London - One of London's great boutique hotels.">
<meta name="keywords" content="Luxury Hotels, Boutique Hotels, Boutique Hotels London, England, United Kingdom, Britain, Resorts, Boutique Hotel, Spa London, Wine Tours, Wine, Design Hotels, Luxury Spa, Hotels London, Accomodation, Accomodation London,">

<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//-->
</script>
<style type="text/css">
<!--
body,td,th {	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000000;
}
body {
	background-color: #CCCCCC;
	margin-left: 0px;
	margin-top: 30px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.red {color: #CC0000}

a:link {
	color: #000000;
}
a:visited {
	color: #000000;
}
a:hover {
	color: #000000;
}
a:active {
	color: #000000;
}
-->
</style>
<link href="text.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
}
-->
</style>

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
  for (i=1; i<a.length;i=i+4){
    if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
    o=MM_findObj(a[i].replace(/\[\d+\]/ig,"&quote;));
    o1=MM_findObj(a&#1111;i+1].replace(/\&#1111;\d+\]/ig,&quote;&quote;));
    v=o.value;t=a&#1111;i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidden'){
      if (r&&v.length==0){err=true}
      if (v.length>0)
      if (t==1){ //fromto
        ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
      } else if (t==2){
        rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
      } else if (t==3){ // date
        ma=a[i+1].split("#");at=v.match(ma[0]);
        if(at){
          cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
          dte=new Date(cy,cm,cd);
          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
        }else{err=true}
      } else if (t==4){ // time
        ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
      } else if (t==5){ // check this 2
            if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!o1.checked){err=true}
      } else if (t==6){ // the same
            if(v!=MM_findObj(a[i+1]).value){err=true}
      }
    } else
    if (!o.type&&o.length>0&&o[0].type=='radio'){
          at = a[i].match(/(.*)\[(\d+)\].*/i);
          o2=(o.length>1)?o[at[2]]:o;
      if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
      if (t==2){
        oo=false;
        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
        if(!oo){s+='* '+a[i+3]+'\n'}
      }
    } else if (o.type=='checkbox'){
      if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
      if(t==1&&o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
      if(v.length<a[i+1]){err=true}
    }
    if (err){s+='* '+a[i+3]+'\n'; err=false}
  }
  if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
  document.MM_returnValue = (s=='');
}

function radioJump() {
	document.location ='#comments'
}
//-->
</script>


</head>
<body onLoad="MM_preloadImages('images/sleep_f2.gif','images/eat_f2.gif','images/drink_f2.gif','images/relax_f2.gif','images/book_f2.gif','images/home_f2.gif');">
<div align="center">
    <table border="0" cellpadding="0" cellspacing="0" width="720">
    <!-- fwtable fwsrc="82-home.png" fwbase="gloucester.jpg" fwstyle="Dreamweaver" fwdocid = "1149027562" fwnested="0" -->
    <tr>
      <td><img src="images/spacer.gif" width="156" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="80" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="60" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="80" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="70" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="14" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="55" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="151" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="43" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="11" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
    </tr>
    
  <tr>
      <td colspan="10"><img name="head" src="images/head.gif" width="720" height="55" border="0" alt="<82 Gloucester Place London W1>"></td>
      <td><img src="images/spacer.gif" width="1" height="55" border="0" alt=""></td>
    </tr>
    <tr>
      <td><img name="navleft" src="images/navleft.gif" width="156" height="17" border="0" alt=""></td>
      <td><a href="sleep.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('sleep','','images/sleep_f2.gif',1);"><img name="sleep" src="images/sleep.gif" width="80" height="17" border="0" alt="<sleep>"></a></td>
      <td><a href="eat.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('eat','','images/eat_f2.gif',1);"><img name="eat" src="images/eat.gif" width="60" height="17" border="0" alt="<eat>"></a></td>
      <td><a href="drink.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('drink','','images/drink_f2.gif',1);"><img name="drink&quote; src=&quote;images/drink.gif&quote; width=&quote;80&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&lt;drink&gt;&quote;></a></td>
      <td colspan="2"><a href="relax.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('relax','','images/relax_f2.gif',1);"><img name="relax" src="images/relax.gif" width="84" height="17" border="0" alt="<relax>"></a></td>
      <td><a href="book.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('book','','images/book_f2.gif',1);"><img name="book" src="images/book.gif" width="55" height="17" border="0" alt="<book>"></a></td>
      <td><img name="navright" src="images/navright.gif" width="151" height="17" border="0" alt=""></td>
      <td colspan="2"><a href="index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','images/home_f2.gif',1);"><img name="home" src="images/home.gif" width="54" height="17" border="0" alt="<home>"></a></td>
      <td><img src="images/spacer.gif" width="1" height="17" border="0" alt=""></td>
    </tr>
    <tr>
      <td colspan="10" rowspan="9" align="center" valign="middle" bgcolor="#FFFFFF">        <div align="center">
        <form name="form1" method="post" action="ProcessContact.php" id="form1" onSubmit="YY_checkform('form1','ContactEmail[0]','#q','2','Field \'ContactEmail[0]\' is not valid.','Name','#q','0','Field \'Name\' is not valid.','EMail','#S','2','Field \'EMail\' is not valid.');return document.MM_returnValue">
          <table width="600" border="0" cellspacing="4" cellpadding="0" style="border: 1px solid #333333;">
            <tr>
              <td>&nbsp;</td>
              <td colspan="2">reservation details</td>
              <td width="74">&nbsp;</td>
              <td width="74">&nbsp;</td>
              <td width="13" rowspan="7" style="border-left: 2px solid #999999;">&nbsp;</td>
              <td colspan="2">comments / requirements</td>
              <td width="24">&nbsp;</td>
            </tr>
            <tr>
              <td width="1">&nbsp;</td>
              <td width="199"><div align="right">Check in </div></td>
              <td width="63"><select name="inDate" class="formFont">
                  <option value="">Date</option>
                  <option value="1">1</option>
                  <option value="2">2</option>
                  <option value="3">3</option>
                  <option value="4">4</option>
                  <option value="5">5</option>
                  <option value="6">6</option>
                  <option value="7">7</option>
                  <option value="8">8</option>
                  <option value="9">9</option>
                  <option value="10">10</option>
                  <option value="11">11</option>
                  <option value="12">12</option>
                  <option value="13">13</option>
                  <option value="14">14</option>
                  <option value="15">15</option>
                  <option value="16">16</option>
                  <option value="17">17</option>
                  <option value="18">18</option>
                  <option value="19">19</option>
                  <option value="20">20</option>
                  <option value="21">21</option>
                  <option value="22">22</option>
                  <option value="23">23</option>
                  <option value="24">24</option>
                  <option value="25">25</option>
                  <option value="26">26</option>
                  <option value="27">27</option>
                  <option value="28">28</option>
                  <option value=&quote;29&quote;&gt;29&lt;/option&gt;
                  &lt;option value=&quote;30&quote;&gt;30&lt;/option&gt;
                  &lt;option value=&quote;31&quote;&gt;31&lt;/option&gt;
              &lt;/select&gt;&lt;/td&gt;
              &lt;td&gt;&lt;select name=&quote;inMonth&quote; class=&quote;formFont&quote;&gt;
                  &lt;option value=&quote;&quote;&gt;Month&lt;/option&gt;
                  &lt;option value=&quote;1&quote;&gt;Jan&lt;/option&gt;
                  &lt;option value=&quote;2&quote;&gt;Feb&lt;/option&gt;
                  &lt;option value=&quote;3&quote;&gt;Mar&lt;/option&gt;
                  &lt;option value=&quote;4&quote;&gt;Apr&lt;/option&gt;
                  &lt;option value=&quote;5&quote;&gt;May&lt;/option&gt;
                  &lt;option value=&quote;6&quote;&gt;Jun&lt;/option&gt;
                  &lt;option value=&quote;7&quote;&gt;Jul&lt;/option&gt;
                  &lt;option value=&quote;8&quote;&gt;Aug&lt;/option&gt;
                  &lt;option value=&quote;9&quote;&gt;Sep&lt;/option&gt;
                  &lt;option value=&quote;10&quote;&gt;Oct&lt;/option&gt;
                  &lt;option value=&quote;11&quote;&gt;Nov&lt;/option&gt;
                  &lt;option value=&quote;12&quote;&gt;Dec&lt;/option&gt;
              &lt;/select&gt;&lt;/td&gt;
              &lt;td&gt;&lt;select name=&quote;inYear&quote; class=&quote;formFont&quote;&gt;
                  &lt;option value=&quote;&quote;&gt;Year&lt;/option&gt;
                  &lt;option value=&quote;05&quote;&gt;2005&lt;/option&gt;
                  &lt;option value=&quote;06&quote;&gt;2006&lt;/option&gt;
                  &lt;option value=&quote;07&quote;&gt;2007&lt;/option&gt;
                  &lt;option value=&quote;08&quote;&gt;2008&lt;/option&gt;
                  &lt;option value=&quote;09&quote;&gt;2009&lt;/option&gt;
              &lt;/select&gt;&lt;/td&gt;
              &lt;td colspan=&quote;2&quote; rowspan=&quote;3&quote;&gt;&lt;textarea name=&quote;comments&quote; cols=&quote;25&quote; rows=&quote;4&quote;&gt;&amp;nbsp;&lt;/textarea&gt;&lt;/td&gt;
              &lt;td&gt;&amp;nbsp;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td&gt;&lt;div align=&quote;right&quote;&gt;Check out &lt;/div&gt;&lt;/td&gt;
              &lt;td&gt;&lt;select name=&quote;outDay&quote; class=&quote;formFont&quote;&gt;
                  &lt;option value=&quote;&quote;&gt;Date&lt;/option&gt;
                  &lt;option value=&quote;1&quote;&gt;1&lt;/option&gt;
                  &lt;option value=&quote;2&quote;&gt;2&lt;/option&gt;
                  &lt;option value=&quote;3&quote;&gt;3&lt;/option&gt;
                  &lt;option value=&quote;4&quote;&gt;4&lt;/option&gt;
                  &lt;option value=&quote;5&quote;&gt;5&lt;/option&gt;
                  &lt;option value=&quote;6&quote;&gt;6&lt;/option&gt;
                  &lt;option value=&quote;7&quote;&gt;7&lt;/option&gt;
                  &lt;option value=&quote;8&quote;&gt;8&lt;/option&gt;
                  &lt;option value=&quote;9&quote;&gt;9&lt;/option&gt;
                  &lt;option value=&quote;10&quote;&gt;10&lt;/option&gt;
                  &lt;option value=&quote;11&quote;&gt;11&lt;/option&gt;
                  &lt;option value=&quote;12&quote;&gt;12&lt;/option&gt;
                  &lt;option value=&quote;13&quote;&gt;13&lt;/option&gt;
                  &lt;option value=&quote;14&quote;&gt;14&lt;/option&gt;
                  &lt;option value=&quote;15&quote;&gt;15&lt;/option&gt;
                  &lt;option value=&quote;16&quote;&gt;16&lt;/option&gt;
                  &lt;option value=&quote;17&quote;&gt;17&lt;/option&gt;
                  &lt;option value=&quote;18&quote;&gt;18&lt;/option&gt;
                  &lt;option value=&quote;19&quote;&gt;19&lt;/option&gt;
                  &lt;option value=&quote;20&quote;&gt;20&lt;/option&gt;
                  &lt;option value=&quote;21&quote;&gt;21&lt;/option&gt;
                  &lt;option value=&quote;22&quote;&gt;22&lt;/option&gt;
                  &lt;option value=&quote;23&quote;&gt;23&lt;/option&gt;
                  &lt;option value=&quote;24&quote;&gt;24&lt;/option&gt;
                  &lt;option value=&quote;25&quote;&gt;25&lt;/option&gt;
                  &lt;option value=&quote;26&quote;&gt;26&lt;/option&gt;
                  &lt;option value=&quote;27&quote;&gt;27&lt;/option&gt;
                  &lt;option value=&quote;28&quote;&gt;28&lt;/option&gt;
                  &lt;option value=&quote;29&quote;&gt;29&lt;/option&gt;
                  &lt;option value=&quote;30&quote;&gt;30&lt;/option&gt;
                  &lt;option value=&quote;31&quote;&gt;31&lt;/option&gt;
              &lt;/select&gt;&lt;/td&gt;
              &lt;td&gt;&lt;select name=&quote;outMonth&quote; class=&quote;formFont&quote;&gt;
                  &lt;option value=&quote;&quote;&gt;Month&lt;/option&gt;
                  &lt;option value=&quote;1&quote;&gt;Jan&lt;/option&gt;
                  &lt;option value=&quote;2&quote;&gt;Feb&lt;/option&gt;
                  &lt;option value=&quote;3&quote;&gt;Mar&lt;/option&gt;
                  &lt;option value=&quote;4&quote;&gt;Apr&lt;/option&gt;
                  &lt;option value=&quote;5&quote;&gt;May&lt;/option&gt;
                  &lt;option value=&quote;6&quote;&gt;Jun&lt;/option&gt;
                  &lt;option value=&quote;7&quote;&gt;Jul&lt;/option&gt;
                  &lt;option value=&quote;8&quote;&gt;Aug&lt;/option&gt;
                  &lt;option value=&quote;9&quote;&gt;Sep&lt;/option&gt;
                  &lt;option value=&quote;10&quote;&gt;Oct&lt;/option&gt;
                  &lt;option value=&quote;11&quote;&gt;Nov&lt;/option&gt;
                  &lt;option value=&quote;12&quote;&gt;Dec&lt;/option&gt;
              &lt;/select&gt;&lt;/td&gt;
              &lt;td&gt;&lt;select name=&quote;outYear&quote; class=&quote;formFont&quote;&gt;
                  &lt;option value=&quote;&quote;&gt;Year&lt;/option&gt;
                  &lt;option value=&quote;05&quote;&gt;2005&lt;/option&gt;
                  &lt;option value=&quote;06&quote;&gt;2006&lt;/option&gt;
                  &lt;option value=&quote;07&quote;&gt;2007&lt;/option&gt;
                  &lt;option value=&quote;08&quote;&gt;2008&lt;/option&gt;
                  &lt;option value=&quote;09&quote;&gt;2009&lt;/option&gt;
              &lt;/select&gt;&lt;/td&gt;
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><div align="right">Adults</div></td>
              <td><select name="Adults" class="formFont">
                  <option value="1">1</option>
                  <option value="2">2</option>
                  <option value="3">3</option>
                  <option value="4">4</option>
                  <option value="5">5</option>
                  <option value="6">6</option>
                  <option value="7">7</option>
                  <option value="8">8</option>
                  <option value="9">9</option>
                  <option value="10">10</option>
              </select></td>
              <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td>Children</td>
                    <td><div align="right">Yes</div></td>
                    <td><input name="Children" type="radio" id="Children" value="yes"></td>
                    <td><div align="right">No</div></td>
                    <td><input name="Children" type="radio" id="Children" value="no" checked></td>
                  </tr>
              </table></td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td colspan="4"><hr /></td>
              <td width="49"><div align="right">Tel</div></td>
              <td width="166"><input name="Tel" type="text" id="Tel" size="25"></td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><div align="right">Single</div></td>
              <td><input name="Beds" type="radio" id="Beds" value="single"></td>
              <td>Double</td>
              <td><input name="Beds" type="radio" id="Beds" value="double"></td>
              <td><div align="right">Name <span class="red">*</span></div></td>
              <td><input name="Name" type="text" id="Name" size="25"></td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><div align="right">Double Deluxe </div></td>
              <td><input name="Beds" type="radio" id="Beds" value="deluxe"></td>
              <td>Any</td>
              <td><input name="Beds" type="radio" id="Beds" value="any">
              </td>
              <td><div align="right">Email <span class="red">*</span></div></td>
              <td><input name="EMail" type="text" id="EMail" size="25"></td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td colspan="7"><hr /></td>
              <td>&nbsp;</td>
            </tr>
            <tr valign="middle">
              <td>&nbsp;</td>
              <td colspan="4">Please get back to me by: Email
                  <input type="checkbox" name="Contact by" id="Contact by" value="email-me">
        Telephone
        <input type="checkbox" name="Contact by" id="Contact by" value="telephone-me">
              </td>
              <td  style="border-left: 2px solid #999999;">&nbsp;</td>
              <td colspan="2">Reference special offer &nbsp;
                  <input name="Ref" type="text" id="Ref" size="12"></td>
              <td>&nbsp;</td>
            </tr>
          </table>
          <table width="600" height="21" border="0">
            <tr>
              <td width="337" align="left" valign="top" scope="col"><br>
        Alternatively call <strong>+44 (0) 20 7486 3679</strong> to make your booking</td>
              <td width="253" align="right" valign="top" scope="col"><input name="ContactEmail" type="hidden" value="info@hotel82london.com">
                  &lt;input name=&quote;submit&quote; type=&quote;submit&quote; value=&quote;submit&quote;&gt;&lt;/td&gt;
            &lt;/tr&gt;
          &lt;/table&gt;
        &lt;/form&gt;
      &lt;/div&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;41&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;9&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;102&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;54&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;11&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;23&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;34&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;11&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td colspan=&quote;10&quote;&gt;&lt;img src=&quote;images/footer.gif&quote; alt=&quote;&lt;site by AM Creative&gt;&quote; name=&quote;footer&quote; width=&quote;720&quote; height=&quote;41&quote; border=&quote;0&quote; usemap=&quote;#footerMap&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;41&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
    &lt;table width=&quote;100%&quote;  border=&quote;0&quote;&gt;
      &lt;tr&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
&lt;/div&gt;
&lt;map name=&quote;footerMap&quote;&gt;
  &lt;area shape=&quote;rect&quote; coords=&quote;662,10,712,19&quote; href=&quote;http://www.amcreative.biz&quote;&gt;
&lt;/map&gt;
&lt;/body&gt;
&lt;/html&gt;
Can anyone offer me advice on how to add in the code I need for the radio buttons too?

Many thanks to all who offer me advice in advance.
Athemiyad in. But I also want to add some further code in that requests the user to select a Single/Double/Double Deluxe or Any choice of room type.

My PHP page (ProcessContact.php) is working fine, but its the HTML form that will need me to add in the code around here:

Code: Select all

form name=&quote;form1&quote; method=&quote;post&quote; action=&quote;ProcessContact.php" id="form1" onSubmit="YY_checkform('form1','ContactEmail[0]','#q','2','Field \'ContactEmail[0]\' is not valid.','Name','#q','0','Field \'Name\' is not valid.','EMail','#S','2','Field \'EMail\' is not valid.');return document.MM_returnValue">
At the moment, it works perfectly if the user doesnt add in their Name or Email, the form will not submit, and an alert comes up -I want to include the radio buttons too. The form has been re-hashed from another form, which is not good -and I am finding that when a user enters some fields on the form and not others, that the email being sent to the inbox after a user submits the form is missing KEY information. I have attached the code of the PHP page here also for viewing...

Code: Select all

<? 
 
$message = "";
 do {
 if (($HTTP_POST_VARS[key($HTTP_POST_VARS)] != "") &&(key($HTTP_POST_VARS) != "ContactEmail")&&(key($HTTP_POST_VARS) != "submit")) {
 $message .= key($HTTP_POST_VARS) . ": " . $HTTP_POST_VARS[key($HTTP_POST_VARS)] . "\n";
 }
 } while(next($HTTP_POST_VARS));
 
 mail($HTTP_POST_VARS["ContactEmail"],"Booking request - from website",$message);
echo ("<script language='javascript'>document.location='thankyou.html'</script>");
?>
I have looked extensively around the net for tutorials on YY_Checkforms and how to add in extra code in order to make sure the user clicks at least ONE of the radio buttons on the page to no luck. The radio buttons are as follows (further down in the code of course):

Code: Select all

&lt;input name=&quote;Beds-single&quote; type=&quote;radio&quote; id=&quote;Beds1&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-double&quote; type=&quote;radio&quote; id=&quote;Beds2&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;Beds-deluxe&quote; type=&quote;radio&quote; id=&quote;Beds3&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-any&quote; type=&quote;radio&quote; id=&quote;Beds4&quote; value=&quote;any&quote;&gt;
The full code of the HTML page with the form in is as follows too: (making sure I get all the info I need to show people my problem!)

Code: Select all

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Welcome to Hotel82London - One of London's great boutique hotels&lt;/title&gt;
&lt;META NAME=&quote;TITLE&quote; CONTENT=&quote;Welcome to Hotel82London - One of London's great boutique hotels&quote;&gt; 
&lt;meta name=&quote;description&quote; content=&quote;Hotel82London - One of London's great boutique hotels.&quote;&gt;
&lt;meta name=&quote;keywords&quote; content=&quote;Luxury Hotels, Boutique Hotels, Boutique Hotels London, England, United Kingdom, Britain, Resorts, Boutique Hotel, Spa London, Wine Tours, Wine, Design Hotels, Luxury Spa, Hotels London, Accomodation, Accomodation London,&quote;&gt;

&lt;script language=&quote;JavaScript&quote;&gt;
&lt;!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf(&quote;?&quote;))&gt;0&amp;&amp;parent.frames.length) {
    d=parent.frames&#1111;n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d&#1111;n])&amp;&amp;d.all) x=d.all&#1111;n]; for (i=0;!x&amp;&amp;i&lt;d.forms.length;i++) x=d.forms&#1111;i]&#1111;n];
  for(i=0;!x&amp;&amp;d.layers&amp;&amp;i&lt;d.layers.length;i++) x=MM_findObj(n,d.layers&#1111;i].document);
  if(!x &amp;&amp; d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i&lt;(a.length-2);i+=3)
   if ((x=MM_findObj(a&#1111;i]))!=null){document.MM_sr&#1111;j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a&#1111;i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&amp;&amp;i&lt;a.length&amp;&amp;(x=a&#1111;i])&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i&lt;a.length; i++)
   if (a&#1111;i].indexOf(&quote;#&quote;)!=0){ d.MM_p&#1111;j]=new Image; d.MM_p&#1111;j++].src=a&#1111;i];}}
}

//--&gt;
&lt;/script&gt;
&lt;style type=&quote;text/css&quote;&gt;
&lt;!--
body,td,th {	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000000;
}
body {
	background-color: #CCCCCC;
	margin-left: 0px;
	margin-top: 30px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.red {color: #CC0000}

a:link {
	color: #000000;
}
a:visited {
	color: #000000;
}
a:hover {
	color: #000000;
}
a:active {
	color: #000000;
}
--&gt;
&lt;/style&gt;
&lt;link href=&quote;text.css&quote; rel=&quote;stylesheet&quote; type=&quote;text/css&quote;&gt;
&lt;style type=&quote;text/css&quote;&gt;
&lt;!--
.style1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
}
--&gt;
&lt;/style&gt;

&lt;script language=&quote;JavaScript&quote; type=&quote;text/JavaScript&quote;&gt;
&lt;!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf(&quote;?&quote;))&gt;0&amp;&amp;parent.frames.length) {
    d=parent.frames&#1111;n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d&#1111;n])&amp;&amp;d.all) x=d.all&#1111;n]; for (i=0;!x&amp;&amp;i&lt;d.forms.length;i++) x=d.forms&#1111;i]&#1111;n];
  for(i=0;!x&amp;&amp;d.layers&amp;&amp;i&lt;d.layers.length;i++) x=MM_findObj(n,d.layers&#1111;i].document);
  if(!x &amp;&amp; d.getElementById) x=d.getElementById(n); return x;
}

function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
  for (i=1; i&lt;a.length;i=i+4){
    if (a&#1111;i+1].charAt(0)=='#'){r=true; a&#1111;i+1]=a&#1111;i+1].substring(1);}else{r=false}
    o=MM_findObj(a&#1111;i].replace(/\&#1111;\d+\]/ig,&quote;&quote;));
    o1=MM_findObj(a&#1111;i+1].replace(/\&#1111;\d+\]/ig,&quote;&quote;));
    v=o.value;t=a&#1111;i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidden'){
      if (r&amp;&amp;v.length==0){err=true}
      if (v.length&gt;0)
      if (t==1){ //fromto
        ma=a&#1111;i+1].split('_');if(isNaN(v)||v&lt;ma&#1111;0]/1||v &gt; ma&#1111;1]/1){err=true}
      } else if (t==2){
        rx=new RegExp(&quote;^&#1111;\\w\.=-]+@&#1111;\\w\\.-]+\\.&#1111;a-zA-Z]{2,4}$&quote;);if(!rx.test(v))err=true;
      } else if (t==3){ // date
        ma=a&#1111;i+1].split(&quote;#&quote;);at=v.match(ma&#1111;0]);
        if(at){
          cd=(at&#1111;ma&#1111;1]])?at&#1111;ma&#1111;1]]:1;cm=at&#1111;ma&#1111;2]]-1;cy=at&#1111;ma&#1111;3]];
          dte=new Date(cy,cm,cd);
          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
        }else{err=true}
      } else if (t==4){ // time
        ma=a&#1111;i+1].split(&quote;#&quote;);at=v.match(ma&#1111;0]);if(!at){err=true}
      } else if (t==5){ // check this 2
            if(o1.length)o1=o1&#1111;a&#1111;i+1].replace(/(.*\&#1111;)|(\].*)/ig,&quote;&quote;)];
            if(!o1.checked){err=true}
      } else if (t==6){ // the same
            if(v!=MM_findObj(a&#1111;i+1]).value){err=true}
      }
    } else
    if (!o.type&amp;&amp;o.length&gt;0&amp;&amp;o&#1111;0].type=='radio'){
          at = a&#1111;i].match(/(.*)\&#1111;(\d+)\].*/i);
          o2=(o.length&gt;1)?o&#1111;at&#1111;2]]:o;
      if (t==1&amp;&amp;o2&amp;&amp;o2.checked&amp;&amp;o1&amp;&amp;o1.value.length/1==0){err=true}
      if (t==2){
        oo=false;
        for(j=0;j&lt;o.length;j++){oo=oo||o&#1111;j].checked}
        if(!oo){s+='* '+a&#1111;i+3]+'\n'}
      }
    } else if (o.type=='checkbox'){
      if((t==1&amp;&amp;o.checked==false)||(t==2&amp;&amp;o.checked&amp;&amp;o1&amp;&amp;o1.value.length/1==0)){err=true}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
      if(t==1&amp;&amp;o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
      if(v.length&lt;a&#1111;i+1]){err=true}
    }
    if (err){s+='* '+a&#1111;i+3]+'\n'; err=false}
  }
  if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
  document.MM_returnValue = (s=='');
}

function radioJump() {
	document.location ='#comments'
}
//--&gt;
&lt;/script&gt;


&lt;/head&gt;
&lt;body onLoad=&quote;MM_preloadImages('images/sleep_f2.gif','images/eat_f2.gif','images/drink_f2.gif','images/relax_f2.gif','images/book_f2.gif','images/home_f2.gif');&quote;&gt;
&lt;div align=&quote;center&quote;&gt;
    &lt;table border=&quote;0&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote; width=&quote;720&quote;&gt;
    &lt;!-- fwtable fwsrc=&quote;82-home.png&quote; fwbase=&quote;gloucester.jpg&quote; fwstyle=&quote;Dreamweaver&quote; fwdocid = &quote;1149027562&quote; fwnested=&quote;0&quote; --&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;156&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;80&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;60&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;80&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;70&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;14&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;55&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;151&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;43&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;11&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;1&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    
  &lt;tr&gt;
      &lt;td colspan=&quote;10&quote;&gt;&lt;img name=&quote;head&quote; src=&quote;images/head.gif&quote; width=&quote;720&quote; height=&quote;55&quote; border=&quote;0&quote; alt=&quote;&lt;82 Gloucester Place London W1&gt;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;55&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img name=&quote;navleft&quote; src=&quote;images/navleft.gif&quote; width=&quote;156&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quote;sleep.htm&quote; onMouseOut=&quote;MM_swapImgRestore()&quote; onMouseOver=&quote;MM_swapImage('sleep','','images/sleep_f2.gif',1);&quote;&gt;&lt;img name=&quote;sleep&quote; src=&quote;images/sleep.gif&quote; width=&quote;80&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&lt;sleep&gt;&quote;&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quote;eat.htm&quote; onMouseOut=&quote;MM_swapImgRestore()&quote; onMouseOver=&quote;MM_swapImage('eat','','images/eat_f2.gif',1);&quote;&gt;&lt;img name=&quote;eat&quote; src=&quote;images/eat.gif&quote; width=&quote;60&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&lt;eat&gt;&quote;&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quote;drink.htm&quote; onMouseOut=&quote;MM_swapImgRestore()&quote; onMouseOver=&quote;MM_swapImage('drink','','images/drink_f2.gif',1);&quote;&gt;&lt;img name=&quote;drink&quote; src=&quote;images/drink.gif&quote; width=&quote;80&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&lt;drink&gt;&quote;&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td colspan=&quote;2&quote;&gt;&lt;a href=&quote;relax.htm&quote; onMouseOut=&quote;MM_swapImgRestore()&quote; onMouseOver=&quote;MM_swapImage('relax','','images/relax_f2.gif',1);&quote;&gt;&lt;img name=&quote;relax&quote; src=&quote;images/relax.gif&quote; width=&quote;84&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&lt;relax&gt;&quote;&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quote;book.htm&quote; onMouseOut=&quote;MM_swapImgRestore()&quote; onMouseOver=&quote;MM_swapImage('book','','images/book_f2.gif',1);&quote;&gt;&lt;img name=&quote;book&quote; src=&quote;images/book.gif&quote; width=&quote;55&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&lt;book&gt;&quote;&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img name=&quote;navright&quote; src=&quote;images/navright.gif&quote; width=&quote;151&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
      &lt;td colspan=&quote;2&quote;&gt;&lt;a href=&quote;index.htm&quote; onMouseOut=&quote;MM_swapImgRestore()&quote; onMouseOver=&quote;MM_swapImage('home','','images/home_f2.gif',1);&quote;&gt;&lt;img name=&quote;home&quote; src=&quote;images/home.gif&quote; width=&quote;54&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&lt;home&gt;&quote;&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;img src=&quote;images/spacer.gif&quote; width=&quote;1&quote; height=&quote;17&quote; border=&quote;0&quote; alt=&quote;&quote;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td colspan=&quote;10&quote; rowspan=&quote;9&quote; align=&quote;center&quote; valign=&quote;middle&quote; bgcolor=&quote;#FFFFFF&quote;&gt;        &lt;div align=&quote;center&quote;&gt;
        &lt;form name=&quote;form1&quote; method=&quote;post&quote; action=&quote;ProcessContact.php&quote; id=&quote;form1&quote; onSubmit=&quote;YY_checkform('form1','ContactEmail&#1111;0]','#q','2','Field \'ContactEmail&#1111;0]\' is not valid.','Name','#q','0','Field \'Name\' is not valid.','EMail','#S','2','Field \'EMail\' is not valid.');return document.MM_returnValue&quote;&gt;
          &lt;table width=&quote;600&quote; border=&quote;0&quote; cellspacing=&quote;4&quote; cellpadding=&quote;0&quote; style=&quote;border: 1px solid #333333;&quote;&gt;
            &lt;tr&gt;
              &lt;td&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td colspan=&quote;2&quote;&gt;reservation details&lt;/td&gt;
              &lt;td width=&quote;74&quote;&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td width=&quote;74&quote;&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td width=&quote;13&quote; rowspan=&quote;7&quote; style=&quote;border-left: 2px solid #999999;&quote;&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td colspan=&quote;2&quote;&gt;comments / requirements&lt;/td&gt;
              &lt;td width=&quote;24&quote;&gt;&amp;nbsp;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td width=&quote;1&quote;&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td width=&quote;199&quote;&gt;&lt;div align=&quote;right&quote;&gt;Check in &lt;/div&gt;&lt;/td&gt;
              &lt;td width=&quote;63&quote;&gt;&lt;select name=&quote;inDate&quote; class=&quote;formFont&quote;&gt;
                  &lt;option value=&quote;&quote;&gt;Date&lt;/option&gt;
                  &lt;option value=&quote;1&quote;&gt;1&lt;/option&gt;
                  &lt;option value=&quote;2&quote;&gt;2&lt;/option&gt;
                  &lt;option value=&quote;3&quote;&gt;3&lt;/option&gt;
                  &lt;option value=&quote;4&quote;&gt;4&lt;/option&gt;
                  &lt;option value=&quote;5&quote;&gt;5&lt;/option&gt;
                  &lt;option value=&quote;6&quote;&gt;6&lt;/option&gt;
                  &lt;option value=&quote;7&quote;&gt;7&lt;/option&gt;
                  &lt;option value=&quote;8&quote;&gt;8&lt;/option&gt;
                  &lt;option value=&quote;9&quote;&gt;9&lt;/option&gt;
                  &lt;option value=&quote;10&quote;&gt;10&lt;/option&gt;
                  &lt;option value=&quote;11&quote;&gt;11&lt;/option&gt;
                  &lt;option value=&quote;12&quote;&gt;12&lt;/option&gt;
                  &lt;option value=&quote;13&quote;&gt;13&lt;/option&gt;
                  &lt;option value=&quote;14&quote;&gt;14&lt;/option&gt;
                  &lt;option value=&quote;15&quote;&gt;15&lt;/option&gt;
                  &lt;option value=&quote;16&quote;&gt;16&lt;/option&gt;
                  &lt;option value=&quote;17&quote;&gt;17&lt;/option&gt;
                  &lt;option value=&quote;18&quote;&gt;18&lt;/option&gt;
                  &lt;option value=&quote;19&quote;&gt;19&lt;/option&gt;
                  &lt;option value=&quote;20&quote;&gt;20&lt;/option&gt;
                  &lt;option value=&quote;21&quote;&gt;21&lt;/option&gt;
                  &lt;option value=&quote;22&quote;&gt;22&lt;/option&gt;
                  &lt;option value=&quote;23&quote;&gt;23&lt;/option&gt;
                  &lt;option value=&quote;24&quote;&gt;24&lt;/option&gt;
                  &lt;option value=&quote;25&quote;&gt;25&lt;/option&gt;
                  &lt;option value=&quote;26&quote;&gt;26&lt;/option&gt;
                  &lt;option value=&quote;27&quote;&gt;27&lt;/option&gt;
                  &lt;option value=&quote;28&quote;&gt;28&lt;/option&gt;
                  &lt;option value=&quote;29&quote;&gt;29&lt;/option&gt;
                  &lt;option value=&quote;30&quote;&gt;30&lt;/option&gt;
                  &lt;option value=&quote;31&quote;&gt;31&lt;/option&gt;
              &lt;/select&gt;&lt;/td&gt;
              &lt;td&gt;&lt;select name=&quote;inMonth&quote; class=&quote;formFont&quote;&gt;
                  &lt;option value=&quote;&quote;&gt;Month&lt;/option&gt;
                  &lt;option value=&quote;1&quote;&gt;Jan&lt;/option&gt;
                  &lt;option value=&quote;2&quote;&gt;Feb&lt;/option&gt;
                  &lt;option value=&quote;3&quote;&gt;Mar&lt;/option&gt;
                  &lt;option value=&quote;4&quote;&gt;Apr&lt;/option&gt;
                  &lt;option value=&quote;5&quote;&gt;May&lt;/option&gt;
                  &lt;option value=&quote;6&quote;&gt;Jun&lt;/option&gt;
                  &lt;option value=&quote;7&quote;&gt;Jul&lt;/option&gt;
                  &lt;option value=&quote;8&quote;&gt;Aug&lt;/option&gt;
                  &lt;option value=&quote;9&quote;&gt;Sep&lt;/option&gt;
                  &lt;option value=&quote;10&quote;&gt;Oct&lt;/option&gt;
                  &lt;option value=&quote;11&quote;&gt;Nov&lt;/option&gt;
                  &lt;option value=&quote;12&quote;&gt;Dec&lt;/option&gt;
              &lt;/select&g

Posted: Mon Jul 04, 2005 9:47 am
by kendall
Yo,

lol... i have to laugh sometimes because i look at the situation of the radio button funny. Now correct me if i am rong (moderaters, gurus, pros) isnt the radio button a form element used in a either or decision. IF so then a radio button purpose is to have a DEFAULT decision to provoke user decision...am i right? i mean think about it

u have these radio buttons

Code: Select all

<input name="Beds-single" type="radio" id="Beds1" value="single">
<input name="Beds-double" type="radio" id="Beds2" value="double">
<input name="Beds-deluxe" type="radio" id="Beds3" value="single">
<input name="Beds-any" type="radio" id="Beds4" value="any">
Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like

Code: Select all

<input name="No_of_Beds" type="radio" id="No_of_Beds" value="single" checked>
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="double">
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="single">
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="any">
thus:

Code: Select all

if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
since you want to use javascript

Code: Select all

<script>
for(i=0;i<=forms[0].length;i++){ // im not sure how to do it but u need to check the number of elements in a form i.e. forms.length
if(forms[0].element[i].type == 'radio'){ // check to see if the element is a radio button
if(forms[0].element[i].value != ''){
var radioChecked =  true;
}
}
}
// if there is a value submit form or arlet message
if(!radioChecked){
alert(error);
}
</script>
ok now im not a javascript person and i dont know the correct syntaxes for it but in a psuedo way that is how u would want to check the radio button. but then again i think a radio button scenario esepcially in a case like yours should have a deafult CHECKED radio. Don't you think

Kendalldecision. IF so then a radio button purpose is to have a DEFAULT decision to provoke user decision...am i right? i mean think about it

u have these radio buttons

Code: Select all

&lt;input name=&quote;Beds-single&quote; type=&quote;radio&quote; id=&quote;Beds1&quote; value=&quote;single&quote;&gt;
&lt;input name="Beds-double" type="radio" id="Beds2" value="double">
<input name="Beds-deluxe" type="radio" id="Beds3" value="single">
<input name="Beds-any" type="radio" id="Beds4" value="any">
Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like

Code: Select all

<input name="No_of_Beds" type="radio" id="No_of_Beds&quote; value=&quote;single&quote; checked&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;any&quote;&gt;
thus:

Code: Select all

if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
[/php:1:756b0ae">
<input name="Beds-deluxe" type="radio" id="Beds3" value="single">
<input name="Beds-any" type="radio" id="Beds4" value="any">
Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like

Code: Select all

<input name="No_of_Beds" type="radio" id="No_of_Beds" value="single" checked>
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="double">
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="single">
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="any">
thus:

Code: Select all

if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
since you want to use javascript

Code: Select all

<script>
for(i=0;i<=forms[0].length;i++){ // im not sure how to do it but u need to check the number of elements in a form i.e. forms.length
if(forms[0].elof the radio button funny. Now correct me if i am rong (moderaters, gurus, pros) isnt the radio button a form element used in a either or decision. IF so then a radio button purpose is to have a DEFAULT decision to provoke user decision...am i right? i mean think about it

u have these radio buttons

[code]
<input name="Beds-single" type="radio" id="Beds1" value="single">
<input name="Beds-double" type="radio" id="Beds2" value="double">
<input name="Beds-deluxe" type="radio" id="Beds3" value="single">
<input name="Beds-any" type="radio" id="Beds4" value="any">
[/code]

Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like
[code]
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="single" checked>
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="double">
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="single">
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="any">
[/code]
thus:
[php]
if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
[/php]
since you want to use javascript

[code]
<script>
for(i=0;i<=forms[0].length;i++){ // im not sure how to do it but u need to check the number of elements in a form i.e. forms.length
if(forms[0].element[i].type == 'radio'){ // check to see if the element is a radio button
if(forms[0].element[i].value != ''){
var radioChecked =  true;
}
}
}
// if there is a value submit form or arlet message
if(!radioChecked){
alert(error);
}
</script>
[/code]

ok now im not a javascript person and i dont know the correct syntaxes for it but in  a psuedo way that is how u would want to check the radio button. but then again i think a radio button scenario esepcially in a case like yours should have a deafult CHECKED radio. Don't you think

Kendallte;Beds-any" type="radio" id="Beds4" value=&quote;any&quote;&gt;
Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like

Code: Select all

&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote; checked&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;any&quote;&gt;
thus:

Code: Select all

if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
since you want to use javascript

Code: Select all

&lt;script&amgurus, pros) isnt the radio button a form element used in a either or decision. IF so then a radio button purpose is to have a DEFAULT decision to provoke user decision...am i right? i mean think about it

u have these radio buttons

[code]
&lt;input name=&quote;Beds-single&quote; type=&quote;radio&quote; id=&quote;Beds1&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-double&quote; type=&quote;radio&quote; id=&quote;Beds2&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;Beds-deluxe&quote; type=&quote;radio&quote; id=&quote;Beds3&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-any&quote; type=&quote;radio&quote; id=&quote;Beds4&quote; value=&quote;any&quote;&gt;
[/code]

Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like
[code]
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote; checked&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;any&quote;&gt;
[/code]
thus:
[php]
if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
[/php]
since you want to use javascript

[code]
&lt;script&gt;
for(i=0;i&lt;=forms&#1111;0].length;i++){ // im not sure how to do it but u need to check the number of elements in a form i.e. forms.length
if(forms&#1111;0].element&#1111;i].type == 'radio'){ // check to see if the element is a radio button
if(forms&#1111;0].element&#1111;i].value != ''){
var radioChecked =  true;
}
}
}
// if there is a value submit form or arlet message
if(!radioChecked){
alert(error);
}
&lt;/script&gt;
[/code]

ok now im not a javascript person and i dont know the correct syntaxes for it but in  a psuedo way that is how u would want to chetuation of the radio button funny. Now correct me if i am rong (moderaters, gurus, pros) isnt the radio button a form element used in a either or decision. IF so then a radio button purpose is to have a DEFAULT decision to provoke user decision...am i right? i mean think about it

u have these radio buttons

[code]
&lt;input name=&quote;Beds-single&quote; type="radio" id="Beds1" value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-double&quote; type=&quote;radio&quote; id=&quote;Beds2&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;Beds-deluxe&quote; type=&quote;radio&quote; id=&quote;Beds3&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-any&quote; type=&quote;radio&quote; id=&quote;Beds4&quote; value=&quote;any&quote;&gt;
[/code]

Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like
[code]
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote; checked&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;any&quote;&gt;
[/code]
thus:
[php]
if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
[/php]
since you want to use javascript

[code]
&lt;script&gt;
for(i=0;i&lt;=forms&#1111;0].length;i++){ // im not sure how to do it but u need to check the number of elements in a form i.e. forms.length
if(forms&#1111;0].element&#1111;i].type == 'radio'){ // check to see if the element is a radio button
if(forms&#1111;0].element&#1111;i].value != ''){
var radioCheckeve to laugh sometimes because i look at the situation of the radio button funny. Now correct me if i am rong (moderaters, gurus, pros) isnt the radio button a form element used in a either or decision. IF so then a radio button purpose is to have a DEFAULT decision to provoke user decision...am i right? i mean think about it

u have these radio buttons

[code]
<input name="Beds-single" type="radio" id="Beds1" value="single">
<input name="Beds-double" type="radio" id="Beds2" value="double">
<input name="Beds-deluxe" type="radio" id="Beds3" value="single">
<input name="Beds-any" type="radio" id="Beds4" value="any">
[/code]

Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like
[code]
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="single" checked>
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="double">
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="single">
<input name="No_of_Beds" type="radio" id="No_of_Beds" value="any">
[/code]
thus:
[php]
if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
[/php]
since you want to use javascript

[code]
<script>
for(i=0;i<=forms[0].length;i++){ // im not sure how to do it but u need to check the number of elements in a form i.e. forms.length
if(forms[0].element[i].type == 'radio'){ // check to see if the element is a radio button
if(forms[0].element[i].value != ''){
var radioChecked =  true;
}
}
}
// if there is a value submit form or arlet message
if(!radioChecked){
alert(error);
}
</script>
[/code]

ok now im not a javascript person and i dont know the correct syntaxes for it but in  a psuedo way that is how u would want to check the radio button. but then again i think a radio button scenario esepcially in a case like yours should have a deafult CHECKED radio. Don't you think

Kendallon of the radio button funny. Now correct me if i am rong (moderaters, gurus, pros) isnt the radio button a form element used in a either or decision. IF so then a radio button purpose is to have a DEFAULT decision to provoke user decision...am i right? i mean think about it

u have these radio buttons

[code]
&lt;input name=&quote;Beds-single&quote; type=&quote;radio&quote; id=&quote;Beds1&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-double&quote; type=&quote;radio&quote; id=&quote;Beds2&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;Beds-deluxe&quote; type=&quote;radio&quote; id=&quote;Beds3&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-any&quote; type=&quote;radio&quote; id=&quote;Beds4&quote; value=&quote;any&quote;&gt;
[/code]

Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like
[code]
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote; checked&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;any&quote;&gt;
[/code]
thus:
[php]
if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
[/php]
since you want to use javascript

[code]
&lt;script&gt;
for(i=0;i&lt;=forms&#1111;0].length;i++){ // im not sure how to do it but u need to check the number of elements in a form i.e. forms.length
if(forms&#1111;0].element&#1111;i].type == 'radio'){ // check to see if the element is a radio button
if(forms&#1111;0].element&#1111;i].value != ''){
var radioChecked =  true;
}
}
}
// if there is a value submit form or arlet message
if(!radioChecked){
alert(error);
}
&lt;/script&gt;
[/code]

ok now im not a javascript person and i dont know the correct syntaxesbecause i look at the situation of the radio button funny. Now correct me if i am rong (moderaters, gurus, pros) isnt the radio button a form element used in a either or decision. IF so then a radio button purpose is to have a DEFAULT decision to provoke user decision...am i right? i mean think about it

u have these radio buttons

[code]
&lt;input name=&quote;Beds-single&quote; type=&quote;radio&quote; id=&quote;Beds1&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-double&quote; type=&quote;radio&quote; id=&quote;Beds2&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;Beds-deluxe&quote; type=&quote;radio&quote; id=&quote;Beds3&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;Beds-any&quote; type=&quote;radio&quote; id=&quote;Beds4&quote; value=&quote;any&quote;&gt;
[/code]

Now why would you leave these choices unchecked? i mean given the fact that the rooms come with different no of beds the fact remains a room must have atleast 1 bed...am i right? Not that a person cant decide on what he wants but it unlikely he wud leave this out but why not DEFAULT it to "single" in any case? wouldnt hurt would it? each room has at least 1 bed?

in any case though...youre using the radio buttons wrong....it should be used like
[code]
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote; checked&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;double&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;single&quote;&gt;
&lt;input name=&quote;No_of_Beds&quote; type=&quote;radio&quote; id=&quote;No_of_Beds&quote; value=&quote;any&quote;&gt;
[/code]
thus:
[php]
if(key($HTTP_POST_VARS) == "No_of_Beds" && $HTTP_POST_VARS['No_of_Beds'] != ''){
echo $HTTP_POST_VARS['No_of_Beds'] // single by default option
}
[/php]
since you want to use javascript

[code]
&lt;script&gt;
for(i=0;i&lt;=forms&#1111;0].length;i++){ // im not sure how to do it but u need to check the number of elements in a form i.e. forms.length
if(forms&#1111;0].element&#1111;i].type == 'radio'){ // check to see if the element is a radio button
if(forms&#1111;0].element&#1111;i].value != ''){
var radioChecked =  true;
}
}
}
// if there is a value submit form or arlet message
if(!radioChecked){
alert(error);
}
&lt;/script&gt;
ok now im not a javascript person and i dont know the correct syntaxes for it but in a psuedo way that is how u would want to check the radio button. but then again i think a radio button scenario esepcially in a case like yours should have a deafult CHECKED radio. Don't you think

Kendall