Jump to content

PGCoder

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by PGCoder

  1. /push Can anyone tell me why this happen to me? :-/
  2. /push Can someone tell me why this condition <!-- [if IE]> <![endif]--> don't work with IE10?
  3. Thank you. In my conditions I retrieve IE/!IE but IE10 doesn't use the stylesheet of the IE condition - it opens the condition of !IE as IE10 I use the same condition like on the website you linked me:
  4. Big thank you, justsomeguy!!! You do an awesome job here in this forum!I called my php file with "http://..." while I am using a SSL certificate.So I only changed the path to "https://..." - done! :)I have another question:How can I retrieve the browser version? My website displays the content totally wrong with IE10.Here is my code - but it doesn't check IE10 :o[CODE] <!--[IF IE]> IE10 doesn't call this line!!!<link href='css/layout_ie.css' rel='stylesheet' type='text/css' /><![ENDIF]--><!--[IF !IE]> --> <link href='css/layout_webkit.css' rel='stylesheet' type='text/css' /><!-- <![ENDIF]-->[/CODE]
  5. I start to debug but the IE Developer Tool doesn't record any error . . .
  6. Hello w3schools- community, i created a support form with jquery. When the customer fill out the form fields and press submit an $.POST function request to my "sendEmail.php" file (from there the php code generate my support email that includes header, body, and more) The support form works with Safari and Chrome but it doesn't work with Internet Explorer 10 (I only own IE10). Everytime an email was sent successful I output something like "Thank you for contacting .... blablabla". This message isn't shown on IE10 after pressing "submit" button. Have a nice day,PGCoder
  7. PGCoder

    Form Style

    Ok! Here is my code: form_layout.css: #register-form { margin-bottom: 30px; margin-left: 20px; margin-top: 10px; padding: 25px 50px 10px;}#register-form .fieldgroup { display: inline-block; /* inline-block */ width: 340px;}#register-form .fieldgroup label { float: left; padding: 15px 0 0; text-align: right; width: 110px;}#register-form .fieldgroup input, #register-form .fieldgroup select { float: right; margin: 10px 0; height: 25px;}#register-form .fieldgroup textarea { float: right; margin: 10px 0;}#register-form .submit { padding: 10px; width: 220px; height: 40px !important;}#register-form .fieldgroup label.error { color: #FB3A3A; margin: 4px 0 5px 125px; padding: 0; text-align: left; width: 220px;} request_layout.css: #panel_form{ padding:2px; text-align:center; background-color:#2995f6; border:solid 4px #ffffff; border-radius: 20px;}#panel_form{ padding:50px; display:none;} layout.css: #textContent {width:100%;position:relative;z-index:3;}#textMiddle {width:740px;}.textBox {border:4px solid white;background-image:url(../images/gradient.png);background-position:left top;background-repeat:repeat-x;-webkit-border-radius: 10px;-khtml-border-radius: 10px;-moz-border-radius: 10px;border-radius: 10px;padding: 0 20px 5px 20px;color:#ffd723;}#supportInner {top:-24px;}h1#supportHeader {width:218px;height:50px;background-image:url(../images/support.png);background-repeat:no-repeat;text-indent:-9999px;}#screenshotsInner {position:relative;top:-24px;}h1#screenshotsHeader {width:269px;height:60;background-image:url(../images/screenshots.png);background-repeat:no-repeat;text-indent:-9999px;} support.php: <center> <div id='textContent'> <div id='textMiddle'> <div class="textBox"> <div id='supportInner'> <h1 id='supportHeader'>Support</h1> <form action="" method="post" id="register-form" novalidate="novalidate"><div id="panel_form"> <input type="button" class="back_form" value="Back" name="Back" /> <div id="form-content"> <div id="requestSummary"></div> <div id="form_output"></div> <div class="fieldgroup"> <label for="subject">Subject:</label> <input type="text" name="form_subject" id="form_subject"> </div> <div class="fieldgroup"> <label for="name">Name:</label> <input type="text" name="form_name" id="form_name"> </div> <div class="fieldgroup"> <label for="email">Email:</label> <input type="text" name="form_email" id="form_email"> </div> <div class="fieldgroup"> <label for="message">Message:</label> <textarea name="form_message" id="form_message" rows="6" cols="28"></textarea> </div> <div class="fieldgroup"> <input type="submit" value="Submit" class="submit"> </div> </div> </div> </form> </div> </div></center>
  8. PGCoder

    Form Style

    Dear W3School- Community, I have a problem with a form style. My form should fit in light blue box as you can see on the screenshot. The id tag is following: #register-form .fieldgroup { display: block; width: 340px;} If I change the display property to "inline-block" I achieve my concern but the form changed the position to the right and isn't centered anymore!Do I need other properties? I would appreciate a reply,PGCoder error.tiff
  9. My debugger tells me following:Network Requests: sendEmail.php(Name) - XHR(Type) - 200(Status) - No(Cached) - 157B(Transfered) - 279ms(Latency) - 1.8ms(Duration)Javascript & Events: Event Dispatched(Type) - submit(Details) - jquery.min.js:2(Location) - 15.32s(Start Time) - 9.2ms(Duration) Does the Ajax request take too long? Also I can only see one debug line @ Network Requests but no multiply calls ...
  10. I only send one $.post at the first submit click and if that was successful I hide the complete form ( $("#requestSummary").hide(); + $("#.fieldgroup").hide(); + $("#back_form").hide(); ).When I fill out the form I receive always one email - where can I see the number of $.post send?I thought that users click the submit button multiply times - but after one successful $.post I hide the complete form. :-/
  11. I get my code to work now. But I have a new issue :-/The messages are sent multiply times - so it happens that I receive 10 times the same message and sometimes only one. What could this bug be? Here is the new javascript code: $(document).ready(function(){ $("#register-form").validate({ rules: { form_subject:"required", form_name:"required", form_email: { required:true, email:true }, form_message:"required" }, messages: { form_subject: "Please enter a subject", form_name: "Please enter your name", form_email: "Please enter a valid email address", form_message: "Please enter your message" }, submitHandler: function(form) { $.post('sendEmail.php', $(form).serialize(), function () { $("#form_output").html("<b>Thank you for contacting us. We have received your message and look forward to answer you as soon as possible.</b>"); $("#requestSummary").hide(); $(".fieldgroup").hide(); $(".back_form").hide(); //$("#register-form").hide(); //form.submit(); },'json'); } });}); Here is the php file to send an email: <?php//Request Form$s_output = $_POST['selection']; $s_b_output = $_POST['selection_business']; $s_o_output = $_POST['selection_opsy']; $s_i_d_output = $_POST['selection_ios_device']; $s_i_v_output = $_POST['selection_ios_version']; $s_a_d_output = $_POST['selection_android_device'];//Form$subject=$_POST['form_subject'];$name=$_POST['form_name'];$email=$_POST['form_email'];$message=$_POST['form_message'];$header="";$mail_to=""; //Business if($s_output=="Business") { $mail_to="business@mydomain.com"; $header="Form Output: " . $s_output . " -> " . $s_b_output; } //Support if($s_output=="Support") { $mail_to="support@mydomain.com"; $header="Form Output: " . $s_output . " -> " . $s_o_output . " -> " . $s_i_d_output . " -> " . $s_i_v_output; }$content=$header . "\n\nName: " . $name . "\nEmail: " . $email . "\nMessage: " . $message;mail($mail_to, $subject, $content);?>
  12. Edit:I changed the code to following and now I can run the code without any issue/warning. The problem is that ajax doesn't work - the debug console said "Details: -": $(document).ready(function(){ $("#register-form").validate({ rules: { subject:"required", name:"required", email: { required:true, email:true }, message:"required" }, messages: { subject: "Please enter a subject", name: "Please enter your name", email: "Please enter a valid email address", message: "Please enter your message" }, submitHandler: function(form) { $.ajax({ type: 'POST', data: ("#register-form").serialize(), url : 'sendEmail.php' success: function (html) { alert('done'); }, error: function(data, textStatus, jqXHR) { alert('error') } }); form.submit(); } });}); Original: I debugged the javascript file "Javascript Validation/Ajax" is the issue: Error target to the last line: })(jQuery, window, document);Following error output @ console: TypeError: '[object Object]' is not a function (near '...})(jQuery, window, doc...')
  13. Ok I found it but it doesnt show me anything about ajax.Is there another way to simply send an email? I read something about .post function?! Or can you suggest another way/function to send an email?A Depressive coder,PGCoder
  14. I am using Safari on my iMac. But I am not able to see the ajax request.
  15. Thank you for your reply. I am directly connected to my webserver and change the webspace files. I can't debug with a tool now. Any other suggestions?
  16. Hello w3schools community, i build a feedback form for my website. I use JQuery to create the form and check the input validation.This works fine but when the user fill out the form I am not able to send me a mail. I can't run a php code in a javascript function so I use a the ajax function by JQuery to send data to a php page. The problem is that something must be wrong with the data transmission because i can't send a mail. If I run the PHP page (sendEmail.php) I receive an email. But if I fill out the form and want to submit - the ajax function doesn't call the PHP page. I could be wrong but the form validation and the mail php code is working well . . . so ajax must be the problem! Here is the relevant code for this form I have now: HTML FORM: <div class="fieldgroup"> <label for="subject">Subject:</label> <input type="text" name="subject" id="subject"> </div> <div class="fieldgroup"> <label for="name">Name:</label> <input type="text" name="name" id="name"> </div> <div class="fieldgroup"> <label for="email">Email:</label> <input type="text" name="email" id="email"> </div> <div class="fieldgroup"> <label for="message">Message:</label> <input type="text" name="message" id="message"> </div> <div class="fieldgroup"> <input type="submit" value="Submit" class="submit"> </div> JAVASCRIPT VALIDATION + AJAX: $(function($,W,D) { var JQUERY4U = {}; JQUERY4U.UTIL = { setupFormValidation: function() { //form validation rules $("#register-form").validate({ rules: { subject: "required", name: "required", email: { required: true, email: true }, message: "required" }, messages: { subject: "Please enter a subject", name: "Please enter your name", email: "Please enter a valid email address", message: "Please enter your message" }, submitHandler: function(form) { $.ajax({ type: "POST", url: "sendEmail.php", data: { sendSubject : subject, sendName: name, sendEmail: email, sendMessage: message } }); form.submit(); } }); } } $(D).ready(function($) { JQUERY4U.UTIL.setupFormValidation(); }); })(jQuery, window, document); PHP PAGE (sendEmail.php): <?php $sendSubject = $_POST['sendSubject']; $sendName = $_POST['sendName']; $sendEmail = $_POST['sendEmail']; $sendMessage = $_POST['sendMessage']; if(mail($sendEmail, $sendSubject, $sendName, $sendMessage)){ echo 'sent'; } else { echo 'failed'; }?> Thanks,PGCoder
×
×
  • Create New...