Jump to content

[SOLVED] Populating textboxes upon selecting from dropdown control


dualshock03

Recommended Posts

pratically im stilll a newbie to this PHP Dreamweaver coding.. and im still on the basics using notepad..

 

i want to know how to populate the data to  the textbox and labels upon selecting a "record"/ or a "word" list,  from a drop down list control in dreamweaver... the drop down list is database dependent " i mean the lists are from the database and then whenever i choose one list, its corresponding records will appear from the lables, textboxes some list/menus..

 

Hope anyone will give me some good samples.. cheers!! 8)

All I know about AJAX is that it can be used to update webpages without having to reload the webpage.  It is an entirely different language, but there are going to be scripts on the internet that you could use for your own use (at least I would imagine there would be).

hey guys... im coming back to this thread... what if i want to generate its corresponding column records in the database just like searching records:

 

(DROP DOWN)= list are from the db in column "towname"

 

-town1

-town2

-town3

 

----------------

when i click one of the lists... "for exmple i choose "town1" "

then the result on the textbox, labels, and some imageplaceholders will be...

 

textbox = population data of town1

label =  town name data of town1

image placeholder = image data of town1

etc...

 

how will i code it in javascript or in PHP??

 

 

 

 

 

anyone??

 

generating its corresponding column records in the database just like searching records:

 

(DROP DOWN CONTROL)= list are from the db in column "towname"

 

-town1

-town2

-town3

----------------

when i click one of the lists... "for exmple i choose "town1" "

then the result on the textbox, labels, and some imageplaceholders will be...

 

textbox = population data of town1

label =  town name data of town1

image placeholder = image data of town1

etc...

 

how will i code it in javascript or in PHP??

 

 

[attachment deleted by admin]

ok  i already try this codings.. but the result is... all the controls are empty.. the drop down,textbox and the rest became empty.. conflict on mysql query i think..

 

 

mysql query:

 

if (isset($_GET['towname'])) {
  $coldata_list_town_rec = $_GET['towname'];
}
mysql_select_db($database_mySQL, $mySQL);

$query_list_town_rec = sprintf("SELECT towname, num_brgy, townhistory, townborn, town_pop, general_info FROM tbltowns where towname LIKE %s ", GetSQLValueString("%" . $coldata_list_town_rec . "%", "text"));

$list_town_rec = mysql_query($query_list_town_rec, $mySQL) or die(mysql_error());
$row_list_town_rec = mysql_fetch_assoc($list_town_rec);
$totalRows_list_town_rec = mysql_num_rows($list_town_rec);
?>

 

 

<form action="/lcr8/townspots.php" method="post" name="formdropdown" id="formdropdown">
    <label> </MM:DECORATION>
    </MM_REPEATEDREGION>
    <MM_REPEATEDREGION SOURCE="@@rs@@">
    </label>
    <span id="spryselect1">
    <label>
    <select name="towname" id="towname">
      <option value="value">Select Municipality...</option>
      
<?php
          do {  ?>
      <option value="<?php echo $row_list_town_rec['towname']?>"><?php echo $row_list_town_rec ['towname']?></option>
      <?php
} while ($row_list_town_rec = mysql_fetch_assoc($list_town_rec));
  $rows = mysql_num_rows($list_town_rec);
  if($rows > 0) {
      mysql_data_seek($list_town_rec, 0);
  $row_list_town_rec = mysql_fetch_assoc($list_town_rec);
  }
?>
    </select>
    </label>
    <span class="selectRequiredMsg">Please select an item.</span>    </span>
  </form>

MY TOPIC IS SOLVED thanks for the tips!

 

i just found this forum page which has match similar to my problem and it worked for me..

so easy to say than really done..

 

http://www.webmasterworld.com/forum88/6628.htm

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.