Code: Select all
if (document.commande.fax.value=="") {
alert("Veuillez inscrire votre numero de fax")
return (false)
}what's the code?
i'm not good with javascript..
thx in advance
Moderator: General Moderators
Code: Select all
if (document.commande.fax.value=="") {
alert("Veuillez inscrire votre numero de fax")
return (false)
}Code: Select all
<select onchange="validation code/function here">
<option value="blah">
</select>Code: Select all
this.optionsїthis.selectedIndex].valueCode: Select all
function checkform(commande)
{
if (document.commande.firstname.value=="") {
alert("Veuillez inscrire votre prénom")
return (false)
}
if (document.commande.lastname.value=="") {
alert("Veuillez inscrire votre nom de famille")
return (false)
}
and so onCode: Select all
<select name="lignes" class="lignes">
<option value="--">--</option>
<option value="ren">Renaissance</option>
<option value="oxy">Oxygene Botanical</option>
<option value="bio">Biocella</option>
<option value="atzen">Atzen</option>
<option value="adeeva">Adeeva</option>
<option value="escential">Escential</option>
</select>Code: Select all
onsubmit="return checkform(this)"Code: Select all
var select = document.commande.lignes;
if(select && select.optionsїselect.selectedIndex].value == '--')
{
alert('nothing selected');
return false;
}