Forums

Validation Issue

mattyp73 16 Jun, 2008
I have problem with data validation.

I understand there are the Javascript instrucitons but I am confiserd about the VALIDATION tab in the settings.

Is i put the field details in here and activate validation, this does not validate my field?

Do I still have to put the script etc in the html ... if so then what is the function of the VALIDATION tab.

Thanks

Matt
miedah 16 Jun, 2008
haiii

I have a form that we can add, update and retrieve the data.
I use disabled function to control my form using select option. for example when user select "active", the form will be enable and where user select "not_active" the form will be disbled. the problem is when i select "not_active" the data in the form will become a null after upadetion. it like diabled will erassed my data in the database. i dont what it problem? can some one tell me. i use ibm websphere(html)and oracle(sql).
GreyHead 16 Jun, 2008
Hi Matt,

Putting the field names in the Validation tab and setting validation to 'On' should validate your fields. No other scripts are required.

If this isn't working then there is most likely either a JavaScript conflict with something else on the page, or a problem with your form code.

Is the form on-line so I can take a look?

Bob
Bacardo 27 Jun, 2008
Hi Bob, I'd the same issue that mattyp73, I'd enabled mootools and validation tab, but nothing happens in the form when I click submit, the form send the mail but no validation occurs.

I must add the class= value in all elements, according the different validations?

This is the form code

<style type="text/css"> 
<!-- 
  legend 
{ 
color:#FFFFFF; 
background:#EB178A; 
padding: 1px 4px; 
} 
fieldset 
{
	border: 1px solid #EB178A;
	width: 90%;
	background-color:#FDFDFD
} 

label 
{ 
width: 180px; 
float: left; 
text-align: right; 
display: block; 
} 

select { 
margin-left: 200px;
text-align: left;  
} 
   
input[type="text"]
{ 
color: #000; 
margin-left: 20px;
border: 1px solid #781351; 
} 
 
input[type="submit"] 
{
margin-left: 200px;	
color: #000;
border: 2px outset #d7b9c9;
background-color: #EAEAEA;
} 
input[type="button"] 
{
color: #000;
border: 1px outset #d7b9c9;
background-color: #FFFFFF;
} 
--> 
</style> 
<span style="font-size: large;"><span style="color: rgb(235, 23, 138);"><i><b>CONTRATACIONES</b></i></span></span><br><br>
<fieldset><legend><strong>Artista</strong></legend> 
  <p>      <select name="artista">
          <option value="">Elegir Artista</option>
          <option value="damiandp">Damian DP</option>
          <option value="darioef">DarioEF</option>
          <option value="detune">Detune</option>
          <option value="facucruz">Facu Cruz</option>
          <option value="niclerner">Nic Lerner</option>
          <option value="sequence">Sequence</option>
          <option value="thr3shold">Thr3shold</option>
          <option value="tombaudelaire">Tom Baudelaire</option>
        </select>
  </p>      
</fieldset><br>
<fieldset><legend><strong>Evento</strong></legend> 
 <p>    <label for="fecha">Fecha (DD/MM/AAAA):</label>
        <input type="text" name="fechaevento" id="fechaevento">
 </p>
 <p>
        <label for="locacion">Locación:</label>
        <input type="text" name="locacion" id="locacion">
 </p>
 <p>
        <label for="capacidad">Capacidad:</label>
        <input type="text" name="capacidad" id="capacidad">
 </p>
 <p>
        <label for="nombreevento">Nombre del Evento:</label>
        <input type="text" name="nombreevento" id="nombreevento">
 </p>
</fieldset><br>

<fieldset><legend><strong>Contratante</strong></legend> 
<p>
        <label for="nombrecontratante">Nombre:</label>
        <input type="text" name="nombrecontratante" id="nombrecontratante">
</p>
<p>
        <label for="telefono">Teléfono de contacto:</label>
        <input type="text" name="telefono" id="telefono">
</p>
<p>
        <label for="mail">Correo electrónico:</label>
        <input type="text" name="mail" id="mail">
</p>
<p>
        <label for="sitioweb">Sitio web:</label>
        <input type="text" name="sitioweb" id="sitioweb">
</p>
</fieldset><br>
<input type="submit" value="Enviar" />


This is the link to the form

http://www.latenttalent.nu/index.php/contrataciones





The capture of the validation tab:


[img=http://img125.imageshack.us/img125/1074/validationtabul6.th.jpg]




Thanks in advance!

Bacardo.
GreyHead 28 Jun, 2008
Hi Bacardo,

Please remove the spaces between the fieldnames in the 'required' list. So field_1,field_2,... not field_1, field_2,

Bob
Bacardo 28 Jun, 2008
Bob, Thanks for your quick reply!:)🙂

I've deleted the spaces between fields, but no success.

None of the validations are archieved.

What do you suggest? Is necessary any other code plus the validation enabled and no spaces?

:( I don't know where the problem is, it's dissapoint me.


Thanks again!

Bacardo


in a Foggy Buenos Aires.
GreyHead 28 Jun, 2008
Hi Barcado,

The HTML looks good to me. But the validation classes aren't being added into the input tags.

I don't see why but I wonder if the css attribute selectors like input[type="text"] are causing the problem. They are pretty rare and might give the validation code indigestion.

Bob
Bacardo 28 Jun, 2008
Hi Bob, I've solved the issue:

The problem was the slash in the path of the js file validators, I've added another slash at the beginning of the URL:

src="components/com_chronocontact/js/prototype.js" type="text/javascript"

changed to

src="/components/com_chronocontact/js/prototype.js" type="text/javascript"


Around line 38 in chronocontact.html.php i've updated with the following:

<?php if( trim($paramsvalues->validate) == 'Yes'){ ?>
			<?php if( trim($paramsvalues->validatetype) == 'prototype'){ ?>
				<script src="/components/com_chronocontact/js/prototype.js" type="text/javascript"></script>
				<script src="/components/com_chronocontact/js/effects.js" type="text/javascript"></script>
				<script src="/components/com_chronocontact/js/validation.js" type="text/javascript"></script>
			<?php } ?>
			<?php if( trim($paramsvalues->validatetype) == 'mootools'){ ?>
				<script src="/components/com_chronocontact/js/mootools-release-1.11.js" type="text/javascript"></script>
				<script src="/components/com_chronocontact/js/mooValidation.js" type="text/javascript"></script>
			<?php } ?>
		<?php } ?>


Thanks for develop this component, and thanks for your support.

This is the link to the form if anybody want it.

Now it Works perfectly!

Regards,

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