Jump to content

Search the Community

Showing results for tags 'onchange'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

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


Age


Donation Link

Found 3 results

  1. I have the following code for my dropbox; <select name="Symptom" id="Symptomid" onchange="LSC(this.value)"> Its options are; <option value="<?php echo $row_RsSymptom['name']?>"><?php echo $row_RsSymptom['name']?></option> i have the script ; <script> function LSC(str) { if (str == "") { document.getElementById("txtHint").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("txtHint").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","LoadSymptomDetails.php?q="+str,true); xmlhttp.send(); } } </script> The LoadSymptomDetails.php has the following lines; $sql1 = mysql_query("SELECT name,description , comments FROM symptoms WHERE symptoms.name ='".$q."'") or die(mysql_error()); The q is not being picked. If i remove the where statement it runs and displays the table. Kindly assist. Azhar
  2. Hello All, I have a form that has a DropDown list that is called from an SQL statement; in the SQL table it has a "name" and "email", what I want is the form to grab the "email" as a variable from a "onChange" event so when my form is posted it carries the "email" as a variable that I can use in a function. I can add the email as a hidden <input> however since I don't know how to create an onChange event to grab the "email" from the SQL instance when the drop down is selected I can't pass the email as a variable when the form is posted. I suppose this either needs to be done in Ajax or using JQuery however I'm not sure what is the best approach or way to do it. Does anyone have any spare time to educate me on this, I've never written Ajax or JQuery code before, trying to do this in php alone does not seem like a solution. Thank you in advance
  3. Hi there ! What i'm traying to do is to get latitude and longitude form imputed postcodes. Which works fine as long as i stick to only one input (first or second seperate). I can't get it to work once i try with both of them. i'm using onchange event .. Please ake a look at the form: <form name="latlon" action="test2a.php" method='post' onchange="return usePointFromPostcode(document.getElementById('postcode').value) && usePointFromPostcode1(document.getElementById('postcode1').value) "> <input id="postcode" type="text" size="10" /><br> <input id="postcode1" type="text" size="10"/><br> Latitude:<input name="lat" type="text" id="lat" size="10"/><br /> Longitude:<input name="lon" type="text" id="lon" size="10"/><br><br> Latitude:<input name="lat1" type="text" id="lat1" size="10"/><br /> Longitude:<input name="lon1" type="text" id="lon1" size="10"/> <input type="submit" value="Get Lat / Lon"/> </form> and a Java Script used to get latitude and longitude: function usePointFromPostcode(postcode, callbackFunction) { localSearch.setSearchCompleteCallback(null, function() { if (localSearch.results[0]) { var resultLat = localSearch.results[0].lat; var resultLng = localSearch.results[0].lng; var point = new GLatLng(resultLat,resultLng); document.forms['latlon'].lat.value=resultLat; document.forms['latlon'].lon.value=resultLng; callbackFunction(point); }else{ alert("Postcode not found!"); } }); localSearch.execute(postcode + ", UK"); } function usePointFromPostcode1(postcode1, callbackFunction) { localSearch.setSearchCompleteCallback(null, function() { if (localSearch.results[0]) { var resultLat = localSearch.results[0].lat; var resultLng = localSearch.results[0].lng; var point = new GLatLng(resultLat,resultLng); document.forms['latlon'].lat1.value=resultLat; document.forms['latlon'].lon1.value=resultLng; callbackFunction(point); }else{ alert("Postcode not found!"); } }); localSearch.execute(postcode1 + ", UK"); } I'm totaly stuck here. What do i do wrong? Will appreciate any help and thank you in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.