Temat: Problem z php lub javascript

Witam, mam formularz, korzystający z biblioteki jquery, w tej formie co poniższy kod komunikat o wysłaniu wiadomości się pojawia ale wiadomość nie dochodzi na pocztę. Jeśli usunę z kodu javascript to wszystko jest ok, a więc podejrzewam konflikt, w którymś miejscu, ale w którym i jak go naprawić to się od wczoraj męcze, jeśli ktoś byłby w stanie pomóc to byłbym bardzo wdzięczny.

Kod formularz.html:
<script type="text/javascript">
$(document).ready(function(){

$("#recordClientPhone").mask("999-999-999");
$("#recordClientPhoneAlt").mask("999-999-999");
$("#recordClientZip").mask("99-999");
$("#recordPropertyZip").mask("99-999");
$("#recordPurchaseZip").mask("99-999");

// add * to required field labels
$('label.required').append(' <strong>*</strong> ');

// accordion functions
var accordion = $("#stepForm").accordion();
var current = 0;

$.validator.addMethod("pageRequired", function(value, element) {
var $element = $(element)
function match(index) {
return current == index && $(element).parents("#sf" + (index + 1)).length;
}
if (match(0) || match(1)) {
return !this.optional(element);
}
return "dependency-mismatch";
}, $.validator.messages.required)

var v = $("#cmaForm").validate({
errorClass: "warning",
onkeyup: false,
onblur: false,
submitHandler: function() {
alert("Wiadomość wysłana, dziękuje!");
}
});

// back buttons do not need to run validation
$("#sf2 .prevbutton").click(function(){
accordion.accordion("activate", 0);
current = 0;
});
$(".open1").click(function() {
if (v.form()) {
accordion.accordion("activate", 1);
current = 1;
}
});
$(".open0").click(function() {
if (v.form()) {
accordion.accordion("activate", 0);
current = 0;
}
});

});
</script>
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
</head>


<body>

<div id="wrap">
<div id="main">

<form name="cmaForm" id="cmaForm" method="post" action="check.php">
<input type="hidden" name="recordRequestPrimaryServiceID" id="recordRequestPrimaryServiceID" value="100" />
<input type="hidden" name="recordClientServices" id="recordClientServices" value="1,2" />
<ul id="stepForm" class="ui-accordion-container">
<li id="sf1"><a href='#' class="ui-accordion-link"> </a>
<div>
<fieldset><legend> Część 1 z 2 </legend>
<div class="requiredNotice">*Pola obowiązkowe</div>
<h3 class="stepHeader">Pytnia na temat 1</h3>
<label for="recordClientNameFirst" class="input required">Imię</label>
<input name="recordClientNameFirst" id="recordClientNameFirst" class="inputclass pageRequired" title="Proszę o wpisanie swojego imienia " maxlength="254" size="20" /> <br />
<label for="recordClientNameLast" class="input required">Nazwisko</label> <input name="recordClientNameLast" id="recordClientNameLast" class="inputclass pageRequired" maxlength="254" title="Proszę o wpisanie swojego nazwiska" /> <br />
<label for="recordClientAddress1" class="input required">Adres</label> <input name="recordClientAddress1" id="recordClientAddress1" class="inputclass pageRequired" maxlength="254" title="Proszę o wpisanie swojego adresu" /> <br />
<label for="recordClientAddress2" class="input"></label> <input name="recordClientAddress2" id="recordClientAddress2" class="inputclass" maxlength="254" /> <br />
<label for="recordClientCity" class="input required">Miasto</label> <input name="recordClientCity" id="recordClientCity" class="inputclass pageRequired" maxlength="254" title="Proszę o wpisanie miasta" /> <br />
<div class="formspacer"></div>
<div class="buttonWrapper"><input name="formNext1" type="button" class="open1 nextbutton" value="Next" alt="Next" title="Następny" /></div>
</fieldset>
</div>
</li>
<li id="sf2">
<a href='#' class="ui-accordion-link">
</a>
<div>
<fieldset><legend> Część 2 of 2 </legend>
<div class="requiredNotice">*Pola obowiązkowe</div>
<h3 class="stepHeader">Pytania na temat 2</h3>
<label for="recordPurchaseMetRealtor" class="input required">Płeć</label> Mężczyzna: <input name="recordPurchaseMetRealtor" type="radio" checked="checked" class="inputclass" value="0" /> Kobieta: <input name="recordPurchaseMetRealtor" type="radio" class="inputclass pageRequired" value="1" title="Proszę wybrać jedną z opcji" /><br>
<label for="recordClientZip" class="input required">Kod pocztowy:</label> <input name="recordClientZip" id="recordClientZip" class="inputclass pageRequired" maxlength="12" title="Proszę wpisać kod pocztowy" /> <br />
<label for="recordClientPhone" class="input required">Numer telefonu</label> <input name="recordClientPhone" id="recordClientPhone" class="inputclass pageRequired" maxlength="254" title="Proszę o wpisanie numeru telefonu" /> <br />
<label for="recordClientEmail" class="input required">Adres e-mail</label> <input name="recordClientEmail" id="recordClientEmail" class="inputclass pageRequired email" maxlength="254" title="Proszę o wpisanie adresu e-mail" /> <br />
<div class="buttonWrapper"><input name="formBack1" type="button" class="open1 prevbutton" value="Back" alt="Back" title="Powrót" />
<input name="submit" type="submit" id="submit" value="Submit" class="submitbutton" alt="Submit" title="Wyślji"></div> </fieldset>
</div>
</li>
</ul>
</form>

</div>
</div>

</body>
</html>





Kod check.php:
<?php
$recordClientNameFirst = $_POST['recordClientNameFirst'];
$recordClientNameLast = $_POST['recordClientNameLast'];
$recordClientAddress1 = $_POST['recordClientAddress1'];
$recordClientAddress2 = $_POST['recordClientAddress2'];
$recordClientCity = $_POST['recordClientCity'];
$recordPurchaseMetRealtor = $_POST['recordPurchaseMetRealtor'];
$recordClientZip = $_POST['recordClientZip'];
$recordClientPhone = $_POST['recordClientPhone'];
$recordClientEmail = $_POST['recordClientEmail'];

$adresdo = "wojtek@pl";
$temat = "formularz"
$zawartosc = "Imię: ".$ecordClientNameFirst."\n"
."Nazwisko: ".$recordClientNameLast."\n"
."Adres1: ".$recordClientAddress1."\n"
."Adres2: ".$recordClientAddress2."\n"
."Miasto: ".$recordClientCity."\n"
."Płeć: ".$recordPurchaseMetRealtor."\n"
."Kod pocztowy: ".$recordClientZip."\n"
."Telefon: ".$recordClientPhone."\n"
."Adres email: ".$recordClientEmail."\n";

$adresod = "www.costam.pl";

mail($adresdo, $temat, $zawartosc, $adresod);
?>
<html>
<head>
<title>komentarz przyjęty</title>
</head>
<body>
<h1>Komentarz przyjęty</h1>
</body>
</html>
Robert S.

Robert S. Big Data Consultant
/ Business-Driven IT
Strategy

Temat: Problem z php lub javascript

Może brak średnika po $temat = "formularz" ?

Temat: Problem z php lub javascript

Nie to nie to, formularz zachowuje się tak jakby kompletnie nie współpracował z plikiem wysyłającym check.php

konto usunięte

Temat: Problem z php lub javascript

A czy gdziekolwiek includujesz samą bibliotekę jquery?
Robert S.

Robert S. Big Data Consultant
/ Business-Driven IT
Strategy

Temat: Problem z php lub javascript

Dorzuć jeszcze jakich bibliotek używasz do mask i accordion, bo nie mamy żadnej możliwości debugowania.
Mirosław Ratman

Mirosław Ratman Manager IT,
Architekt systemów
@Avast, Founder
@aSyncro ...

Temat: Problem z php lub javascript

Wszystko jest OK!!!

jeśli skopiowałeś to od kogoś to poczytaj sobie najpierw o JS/DOM a dokładnie w jaki sposób wysyła sie formularze poprzez JS.

dla podpowiedzi: w jednej z bibliotek jest funkcja która przechwytuje/obsługuje submit na butonieMirosław Ratman edytował(a) ten post dnia 21.06.10 o godzinie 13:36

Temat: Problem z php lub javascript

Poradziłem sobie w trochę inny sposób,wywaliłem dwie linie kodu javascript i wszystko ładnie działa, ale bądź co bądź dziękuje za pomoc. W javascript nie do końca jest dla mnie zrozumiałe, no ale liczy się efekt, działa a więc jest ok :)

Następna dyskusja:

[PHP]IMAP i GMAIL - problem...




Wyślij zaproszenie do