Ik heb een formulier systeem gemaakt.
Het tweede formulier is variabel die wordt opgebouwd aan de hand van de gegevens in het eerste formulier. De derde weer aan de hand van de tweede.
Weet iemand of het ook zonder javascript kan?
Ik heb het zo opgelost nu: (methode)
<html>
<head>
<title>Formulier</title>
<script language="javascript">
<!--
function back(thisForm,targetForm) {
document.thisForm.action.value = targetForm;
}
//-->
</script>
</head>
<body>
<?php
if ($action == "form1") {
?>
...... formulier 1
<?php
} // if ($action == "form1") ...
if ($action == "form2") {
?>
<form name="form2" method="post">
<input type="hidden" ....> ..... data vasthouden
<input type="text" ...... > ...... invoer velden
<input type="submit" name="next" value="Verder">
<input type="submit" name="back" value="Terug" onclick="back('form2','form1');">
<input type="hidden" name="action" value="form3">
</form>
<?php
} // if ($action == "form2") ...
if ($action == "form3") {
?>
.............. formulier 3
<?php
} // if ($action == "form3") ...
if ($action == "sendmail") {
mail opdracht en verzender een melding geven
} // if ($action == "sendmail" ....
?>
</body>
</html>
Het tweede formulier is variabel die wordt opgebouwd aan de hand van de gegevens in het eerste formulier. De derde weer aan de hand van de tweede.
Weet iemand of het ook zonder javascript kan?
Ik heb het zo opgelost nu: (methode)
<html>
<head>
<title>Formulier</title>
<script language="javascript">
<!--
function back(thisForm,targetForm) {
document.thisForm.action.value = targetForm;
}
//-->
</script>
</head>
<body>
<?php
if ($action == "form1") {
?>
...... formulier 1
<?php
} // if ($action == "form1") ...
if ($action == "form2") {
?>
<form name="form2" method="post">
<input type="hidden" ....> ..... data vasthouden
<input type="text" ...... > ...... invoer velden
<input type="submit" name="next" value="Verder">
<input type="submit" name="back" value="Terug" onclick="back('form2','form1');">
<input type="hidden" name="action" value="form3">
</form>
<?php
} // if ($action == "form2") ...
if ($action == "form3") {
?>
.............. formulier 3
<?php
} // if ($action == "form3") ...
if ($action == "sendmail") {
mail opdracht en verzender een melding geven
} // if ($action == "sendmail" ....
?>
</body>
</html>