formularz:
- Kod: Zaznacz cały
<form name="form1" action="javascript:sndPostAbsolwenci();">
<p><b>Imię i nazwisko</b><br>
<input type="text" name="imie" id="imie" width="150" <? echo'value="'.$_POST["imie"].'"';?>>
<br>
<b>Rocznik - rok matury</b><br>
<input type="text" name="rocznik" id="rocznik" width="60" <? echo'value="'.$_POST["rocznik"].'"';?>>
<br>
<b>Klasa</b><br>
<input type="text" name="klasa" id="klasa" width="30" <? echo'value="'.$_POST["klasa"].'"';?>>
<br>
<b>Dane kontaktowe</b><br>
<textarea name="dane" id="dane" rows="2" cols="20"><? echo $_POST["imie"]; ?></textarea>
<input type="submit" name="Submit" id="submit" value="Wyślij">
<br><br>
</p>
</form>
skrypt js:
- Kod: Zaznacz cały
function sndPostAbsolwenci() {
var params = "imie="+encodeURI(document.getElementById('imie').value) + "&rocznik="+encodeURI(document.getElementById('rocznik').value) + "&klasa="+encodeURI(document.getElementById('klasa').value) + "&dane="+encodeURI(document.getElementById('dane').value);
http.open('POST', "link.php?id=absol", true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.send(params);
};
Będę bardzo wdzięczny za pomoc.