dropbox validation fails on safari chrome and opera browser

ajw3208 17 Jul, 2009
Hi Max and Bob,

I have validation turned on a form and it works well on FF, IE7 & 8. The dropbox validation also works well on those browsers. The issue I have is with Safari (windows and MAC), Opera and Chrome.

The dropbox validation does NOT work on with Safari, Chrome and Opera. I need to validate a field (Year field in a DOB) which is vital to my solution. without that validation, the next couple of forms go splat.

examples:

firefox, all OK, similar result on IE
[attachment=1]dropok.jpg[/attachment]

Opera, FAILS. Similar result in Safari (WIN and MAC)
[attachment=0]noval.jpg[/attachment]


Why does this happen?

aj
GreyHead 17 Jul, 2009
Hi aj,

Please post a link to the form, or at least the html for the drop-boxes.

Bob
ajw3208 17 Jul, 2009
Hi Bob,

http://test.wphcfc.net.au/index.php?option=com_chronocontact&chronoformname=rf2 is the form.

I suggest you go the the iste, and slect on-line registration. follow the form flow until you get to rf2. this is to make sure that some of the session variables are set correctly so the form flow behaves correctly.

form code as requested. Happy to giev access to the backend as its a dev site. it may make it quicker. Let me know the best way to pass the credentials.

aj
<?php
	//recover reqd session variables
	$session =& JFactory::getSession();
   $newYrStr = $session->get('sessionregoYear');	
   if ($newYrStr == "")
	{
	//Redirect to back to itself if regoYear is null
	$t =& JFactory::getApplication('site');
  	$t->initialise();
  	$t->redirect('index.php?option=com_chronocontact&chronoformname=rf2');
	}
	$changedDetails = $session->get('sessionchangedDetails');
//	print $changedDetails;	
	if ($changedDetails== "")
	{
	$session->set('sessionchangedDetails',$_GET['changedDetails']);
	$changedDetails = $session->get('sessionchangedDetails');
//	print 'from the get'.$changedDetails;
	}

	$mthDay = $session->get('sessionmthDay');
   $newMthStr = $session->get('sessionMth');
   $newDayStr = $session->get('sessionDay');   
   $regoDate = $session->get('sessionregoDate');
	if ($_GET['dobReqd']==1)
	{
	$playerFirstname = $session->get('sessionplayerFirstname');
	$playerSurname = $session->get('sessionplayerSurname');
	}
	else
	{
	$playerFirstName = "";
	$playerSurName = "";
	}	
   $playerAddress = $session->get('sessionplayerAddress');
   $playerSuburb = $session->get('sessionplayerSuburb');
   $playerPostcode = $session->get('sessionplayerPostcode');
   $playerHomePhoneNum = $session->get('sessionplayerHomePhoneNum');
   $playerWorkPhoneNum = $session->get('sessionplayerWorkPhoneNum');
   $playerMobPhoneNum = $session->get('sessionplayerMobPhoneNum');         
   $playerEmailAddress = $session->get('sessionplayerEmailAddress');
   $parentFirstname = $session->get('sessionparentFirstname');
   $parentSurname = $session->get('sessionparentSurname');
?>

<TABLE WIDTH=90% align="center" BORDER=0 CELLPADDING=0 CELLSPACING=0>
<COL WIDTH=20% ALIGN=left>
<COL WIDTH=80% ALIGN=left>
<tr>
	<TD COLSPAN=2>
	<p><h3>WPHCFC On-Line Registration for Season <?php echo $newYrStr?></h3></p>
	<p><font color="red"><b>You are not registered yet</font></b></p>
	<p>Please complete the details on the form below. Fields marked with an <b><font color="red">*</font></b> are mandatory to complete. Click <b>Next</b> to continue.</p>
	</td>

</tr>
<tr>
	<TD COLSPAN=2>
	<hr>
	</td>
</tr>
<TR>
	<TD>
	<P><I><U><B>Player Details</B></U></I></P>
	</TD>
</TR>
<TR>
	<TD>First Name: <font color="red"><b>*</b></font>
	</TD>
	<TD><p><INPUT TYPE=TEXT NAME="playerFirstname" value="<?php echo $playerFirstname?>" title="Required" SIZE=60 MAXLENGTH=60 /></p>
	</TD>
</TR>
<TR>
	<TD>Surname: <font color="red"><b>*</b></font>
	</TD>
	<TD><p><INPUT TYPE=TEXT NAME="playerSurname" value="<?php echo $playerSurname?>" title="Required" SIZE=60 MAXLENGTH=60 /></p>
	</TD>
</TR>
<TR>
	<TD>Address: <font color="red"><b>*</b></font>
	</TD>
	<TD><p><INPUT TYPE=TEXT NAME="playerAddress" value="<?php echo $playerAddress?>" title="Required" SIZE=60 MAXLENGTH=60 /></p>
	</TD>
</TR>
<TR>
	<TD>Suburb: <font color="red"><b>*</b></font>
	</TD>
	<TD><p>
	<INPUT TYPE=TEXT NAME="playerSuburb" value="<?php echo $playerSuburb?>" SIZE=20 title="Required" MAXLENGTH=20 /> 
	Postcode: <b><font color="red">*</font></b> <INPUT TYPE=TEXT NAME="playerPostcode" value="<?php echo $playerPostcode?>" title="Required as numbers only" SIZE=10 MAXLENGTH=6 /></p>
	</TD>
</TR>
<tr>
	<td>Date of Birth: <font color="red"><b>*</b></font></td>
	<td><p><SELECT NAME="dayDOB"/>
	<OPTION VALUE="" SELECTED>Day</OPTION>
	<?php
	$dDOB=1;
	while ($dDOB<31)
	{
	print '<OPTION VALUE="'.$dDOB.'">'.$dDOB.'</OPTION>';
	$dDOB++;
	}
	?>
	</SELECT> 
	<SELECT NAME="mthDOB"/>
	<OPTION VALUE="" SELECTED>Month</OPTION>
	<?php
	$mDOB=1;
	while ($mDOB<13)
	{
	print '<OPTION VALUE="'.$mDOB.'">'.$mDOB.'</OPTION>';
	$mDOB++;
	}
	?>
	</SELECT> 
	<SELECT NAME="yrDOB"/>
	<OPTION VALUE="" SELECTED>Year</OPTION>
	<?php
	$yDOB=$newYrStr-5;
	while ($yDOB>$newYrStr-60)
	{
	print '<OPTION VALUE="'.$yDOB.'">'.$yDOB.'</OPTION>';
	$yDOB--;
	}
	?>
	</SELECT>
	</p></td>
</tr>
<tr>
	<td>Gender: <font color="red"><b>*</b></font></td>
	<td><p>
	<SELECT NAME="playerGender" title="Required">
	<OPTION VALUE="" SELECTED>Select</OPTION>
        <OPTION VALUE="Male">Male</OPTION>
	<OPTION VALUE="Female">Female</OPTION>
	</SELECT></p>
	</td>
</tr>
<tr>
	<td>Special Needs:</td>
	<td>
	<SELECT NAME="playerSpecialNeeds" />
	<OPTION VALUE="No" SELECTED>No</OPTION>
	<OPTION VALUE="Yes">Yes</OPTION>
	</SELECT> <a href="http://www.wphcfc.net.au/index.php?option=com_content&view=article&id=18&Itemid=51" target='blank'>Click here for more information on Special Needs teams</a> </a>
	</td>
</tr>
<TR>
	<TD><BR>
	</TD>
</TR>
<TR>
	<TD COLSPAN=2><I><U><B>Contact Information</B></U></I>
	</TD>
</TR>
<TR>
	<TD>Home No: <font colour="red"><b>*</b></font></TD>
	<TD><p><INPUT TYPE=TEXT NAME="playerHomePhoneNum" value="<?php echo $playerHomePhoneNum?>" title="Required as numbers only" SIZE=12 MAXLENGTH=12 />
	 Work No: <INPUT TYPE=TEXT NAME="playerWorkPhoneNum" value="<?php echo $playerWorkPhoneNum?>" SIZE=12 MAXLENGTH=12 />
	 Mobile No: <INPUT TYPE=TEXT NAME="playerMobPhoneNum" value="<?php echo $playerMobPhoneNum?>" SIZE=12 MAXLENGTH=12 />
	</p></TD>
</TR>

<TR>
	<TD>Email Address: <font colour="red"><b>*</b></font></tD>
	<TD><P><INPUT TYPE=TEXT NAME="playerEmailAddress" value="<?php echo $playerEmailAddress?>" title="Required in fred@domain.com format" SIZE=60 MAXLENGTH=60 /></P>
	</TD>
</TR>
<TR>
	<TD COLSPAN=2><HR>
	</TD>
</TR>
<TR>
	<TD COLSPAN=2><I><U><B>Parent/Guardian Information is required for players under 16 years of age</B></U></I>
	</TD>
</TR>
<TR>
	<TD>First Name:</TD>
	<TD><p><INPUT TYPE=TEXT NAME="parentFirstname" value="<?php echo $parentFirstname?>" title="Required" SIZE=60 MAXLENGTH=60 /></p>
	</TD>
</TR>
<TR>
	<TD>Surname:</TD>
	<TD><P><INPUT TYPE=TEXT NAME="parentSurname" value="<?php echo $parentSurname?>" title="Required" SIZE=60 MAXLENGTH=60 /></P>
	</TD>
</TR>
<TR>
	<TD><BR></P>
	</TD>
</TR>
<TR>
	<TD COLSPAN=2><HR>
	</TD>
</TR>
		
<TR>
	<TD> 
	</TD>
</TR>

<TR>
	<TD> 
	</TD>
	<TD><P>
	<input TYPE=SUBMIT NAME="rf2sBtn" VALUE="Next" style="width: 100px" />  
	<input TYPE=RESET NAME="rf2restBtn" VALUE="Clear Form" style="width: 100px" /></P>
	</TD>
</TR>
</TABLE>
GreyHead 17 Jul, 2009
Hi aj,

I can't get the drop-down validation to work in FireFox either . . . not sure what it is though. Please will you try a couple of things. First - remove the 'required' validation from the drop-downs. It don't think that required works sensibly with dropdowns. Also take the SELECTED out of the first option - it may be telling the validator that there is a selected option.

Bob
ajw3208 17 Jul, 2009
Ok,

Done, but no change :-(.

I see the validation on FF, but still not on opera (can't test safari at the mo, but I'll get a copy and advise). check out the mess that IE8 makes of dropbox validation.

I'm wondering if the IE8 outcome gives any clues.

thoughts?

aj

IE8's attempt at validating
[attachment=0]ie8validation.JPG[/attachment]
GreyHead 17 Jul, 2009
Hi aj,

There's a fix for the IE8 problem in the forums here - a little snippet to force it into IE7 mode.

Bob
This topic is locked and no more replies can be posted.