End of form changing according to the page
Hi everybody,
I have a problem with a program which must open the good DIV for the corresponding page.
I did not know how to be taken there, then I made this:
(Devis Script.php)
-
<?php
header('Content-Type: application/x-javascript');
$(document).ready( function () {
$(".form_devis_specifique").hide();
if(empty($_REQUEST["p"]))
{
$(".form_devis_specifique .form_Gedep").slideUp("normal", function(){ $(this).parent().removeClass("open")});
}
else
{
switch($_REQUEST["p"])
{
case 21 :
echo '$(".form_devis_specifique .form_Gedep").slideUp("normal", function(){ $(this).parent().removeClass("open")});';
break;
case 2 :
echo '$(".form_devis_specifique .form_Genote").slideUp("normal", function(){ $(this).parent().removeClass("open")});';
break;
case 3 :
echo '$(".form_devis_specifique .form_Gecant").slideUp("normal", function(){ $(this).parent().removeClass("open")});';
break;
}
}
});
?>
In Index.php
-
<script type ="text/javascript" src="Menus/Scripts/DevisScript.php"></script>
and in Devis.php (an extract)
-
<div class = "form_devis_specifique">
<!--formulaire Gedep-->
<div class = "form_Gedep">
<p><label for="type_reseau">Réseau</label><input type="checkbox" name="type_reseau" id="type_reseau" value="checkbox"></p>
<p><label for="type_cpl">Courant Porteur en Ligne</label><input type="checkbox" name="type_cpl" id="type_cpl" value="checkbox"></p>
<p><label for="Nombre_de_salles">Nombre de salles</label><input type="text" name="Nombre_de_salles" id="Nombre_de_salles">
<p><label for="Nombre_de_batiments">Nombre de batiments (Gedep CPL)</label><input type="text" name="Nombre_de_batiments" id="Nombre_de_batiments">
<p><label for="Commentaires">Commentaires</label><textarea name="Commentaires"></textarea>
</div>
<!--formulaire Genote-->
<div class = "form_Genote">
<span>Renseignements Techniques</span>
<span>Objet</span>
<p><label for="Commentaire"><textarea name="Commentaire" id="Commentaire"></textarea></p>
</div>
<!--formulaire Gecant avec carte-->
<div class = "form_Gecant">
<span>Renseignements Techniques</span>
<p><label for="Nombre_eleves_personnels_DP">Nombre d'éléves + personnels DP</label><input type="text" name="Nombre_eleves_personnels_DP" id="Nombre_eleves_personnels_DP">
<p>
<label for="Tripode_anti_panique">Tripode anti-panique</label>
<select name="Tripode_anti_panique" id="Tripode_anti_panique">
<option value="Oui">Oui</option>
<option value="Non">Non</option>
</select>
</p>
<p><label for="Commentaire"><textarea name="Commentaire" id="Commentaire"></textarea></p>
</div>
</div>
but, you owe you doubt it otherwise I would not be there, it does not work...
Then I to ask you for your help? (grieved for errors, I am not English ^^ ")