Jump to content

liebs19

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

About liebs19

  • Birthday 08/06/1984

Contact Methods

  • AIM
    liebs19

Profile Information

  • Gender
    Male
  • Location
    Wisconsin

liebs19's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is the working code involving only the list I was trying to populate. On the page where the list is shown: <br />Select your city: <div id="divCityList"> <select name="Cities" id="Cities"> </select> </div> In the AJAX Javascript: function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById("divCityList").innerHTML=xmlHttp.responseText; } } In the PHP file called by the AJAX: //code here to connect to db and run the query echo '<select name="Cities" id="Cities">'; while ($row = mysql_fetch_array($result)) { $city = $row[City]; echo "<option value=" . $city . ">" . $city . "</option>\n"; } echo '</select>';
  2. What would the response text for this look like? Just an array with the code for the options? How would I return this array through php? This is my first AJAX script, although I am not new to javascript. When I wrote the script and it actually worked right away I was so happy. Then I tried it in IE. What is the reason to not use innerHTML? It seems so easy, and it work everywhere except IE
  3. I found a workaround for this. I had to nest my entire empty select tag inside of a div tag. Then I had to set the innerHTML of this div and echo out the start and end of the select tag as well as all of the option tags in my php script.
  4. Hi guys, I have been working on an AJAX script to populate 1 dropdown box with data from my database when selecting a value in another dropdown box. It works fine in Firefox, Opera, and Safari. However, it will not work in IE. I've been doing some google searches and I have found that IE does not like it when you return HTML data to an innerHTML statement in your AJAX responsetext. There are multiple solutions on how to fix this but none of them are for a listbox. The usually involve nesting div tags and replacing on of them. In my responsetext I am returning multiple <option></option> tags for my listbox, so I don't think that I can do this replace. has anyone come across this problem before? Do you know of a solution to make innerHTML work for a dropdown box in IE when returning HTML in the responsetext? I can post some code if needed but the code isn't the problem. The problem is getting IE to let my innerHTML work.
  5. The primary key should be used as the WHERE clause because it is guaranteed to be unique.
  6. I don't think you can do php inside of javascript. There might be a solution using AJAX, but I only know a little Ajax so I can't help you there. The php code is processed by the server before the browser ever gets the document containing the HTML and javascript.
  7. liebs19

    CSS Fill Div?

    If you wanted to make them always be 300px wide you could use div img { width:300px; height:300px; } I think that would make all images inside div tags be 300px wide and 300px high. It would make images smaller than 300px grow to that size and it would not work well for non-square images. I have not tried this but I think it should work.
  8. That query looks ok to me. Try to echo out your variables to make sure they contain what you expect.
  9. Yeah, change form.php to the location of the file you want to redirect to. It can be anywhere on you site like /forms/input/forminput.php if that is where your file is.
  10. You need to use UPDATE to edit a row. Make sure to include all fields except the id in the values. Then use the ID as the where clause to make sure you only update that 1 row.
  11. Try this: mysql_connect("localhost","root", "") or die(mysql_error()); I don't think that @localhost is needed and the mysql_error() will tell you exactly what the error is if it fails.
  12. So, instead of printing the 0 or 1 you want to print "**download the outline" or ""? If yes, what does it print when you run it with the if statement?
×
×
  • 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.