Jump to content

Search the Community

Showing results for tags 'html form'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. Dear all, some help will be highly appreciated. I have a JS code that has a form for first name and last name. Ajax then communicates with a PHP script and gets back a message from PHP that thanks the user by stating the first and last names of user. The PHP message will show at the bottom of the form without having the page to refresh. The PHP message ensures a successful communication between JS and PHP via Ajax. The JS script:<!DOCTYPE html><html lang="en"><head><script>function ajax_post() {//create our XMLHttpRequest objectvar hr = new XMLHttpRequest();//create some variables we need to send to our PHP filevar url = "my_parse_file.php"; //name of the PHP parsing script.var fn = document.getElementById("first_name").value;var ln = document.getElementById("last_name").value;var vars = "firstname="+fn+"&lastname="+ln; //variables to be sent to PHP scritp.hr.open("post", url, true); //using the open method on XMLHttpRequest object.hr.setRequestHeader("Content_type", "application/x-www-form-urlencoded");// access the onreadystatechange event for the XMLHttpRequest object.hr.onreadystatechange = function() {if (hr.readyState == 4 && hr.status == 200) {var return_data = hr.responseText;document.getElementById("status").innerHTML = return_data;}}// send the data to PHPhr.send(vars);document.getElementById("status").innerHTML = "processing...";}</script></head><body><h2>Ajax Post to PHP and Get Return Data</h2>Your First Name: <input id="first_name" name="first_name" type="text" /><br /><br />Your Last Name: <input id="last_name" name="last_name" type="text" /><br /><br /><input name="myBtn" type="submit" value="Submit Data" onClick="javascript:ajax_post();" /><br /><br /><div id="status"></id></script></body></html>The PHP script:<?phpecho 'Thank you ' . $_POST['firstname'] . ' ' . $_POST['lastname'] . ',says the PHP file.';?>I receive no message back from the PHP script as desired, only the word "processing...".As part of the debugging, I inserted:document.write("Ready State = "+hr.readyState + " Ready Status = "+hr.status);after: hr.onreadystatechange = function() {The message I got was: Ready State = 4 Ready Status = 0.I thought it meant changing the 200 to 0, but still didn't work.My system: Apache, PHP 5.5.9, Windows 64-bit OS, Windows 7
  2. Hello! I am very new to ASPX, and trying to create a form. I need text boxes, date pickup, drop down with multi selection option, radio button, check box, two file upload boxes, text area for terms & Conditions. 1. All fields are required, with complete validation. 2. In text box, where name is to be taken as input also need to be validated if there is any numeric insertion... 3. All error messages with a red cross image, should appear in same column, where there is the input field, aligned properly on right side of input box. 4. the error message image and text should reflect instantly, i.e. the image should be pre loaded. 5. in the date pickup box, date after 10 days of current date should be highlighted. 6. e-mail should be validated properly, and should allow long domain extensions also (e.g. . photography, .mobile etc.), it should not be restricted to three characters. 7. The submit button can be clicked only if the terms & conditions text area, is checked with the check box. 8. If every thing is fine, then the mail is to be sent on gmail id, in a proper form with all text labels and input box text, along with IP address, browser details, and timing when the form was filled. A copy is to be send to the person filling the form. A thanks message should appear on top of form (in first line), and form values to be reset. Can anyone please help with a tested, precise, and easy code, along with the implementation instructions... I do not need the link suggestions. Thanks.
×
×
  • Create New...