close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Populating text fields from dropdown

Thread began 9/27/2012 5:45 pm by rogersds267040 | Last modified 3/30/2015 12:29 pm by rogersds267040 | 6152 views | 20 replies


Prepop Fields

Can someone take a look at the code that I have for the form. I'm trying to prepopulate fields based on selecting a value from the select menu. The first text field is prepopulated correctly with the corresponding value based on the selection. However, I can't get the second text box which is the "color" ID to prepopulate with the correct information. The color text box seems to echo the item_id column. I think my on change statement is correct. However, I think my PHP loop statement may be causing the problem. Can you give suggestions. Thx

<select name="ProductName" id="ProductName"
onChange="document.WADAInsertForm.color.value = document.WADAInsertForm.ProductName[document.WADAInsertForm.ProductName.selectedIndex].text;document.WADAInsertForm.consignor_id.value = document.WADAInsertForm.ProductName[document.WADAInsertForm.ProductName.selectedIndex].value">
<option value="">Select a Material/Equipment</option>
do {
<option value="<?php echo $row_items['consignor_id']?>",><?php echo $row_items['item_id']?></option>


} while ($row_items = mysql_fetch_assoc($items));
$rows = mysql_num_rows($items);
if($rows > 0) {
mysql_data_seek($items, 0);
$row_items = mysql_fetch_assoc($items);
<th nowrap bgcolor="#CCCCCC" class="WADADataTableHeader">Price:</th>
<td class="WADADataTableCell">
<label for="consignor_id">Consignor</label>
<input type="text" name="consignor_id" id="consignor_id" size="32" /></td>
<th nowrap bgcolor="#CCCCCC" class="WADADataTableHeader">SKU:</th>
<td class="WADADataTableCell">
<label for="color">Color</label>
<input name="color" type="text" id="color" size="32"/></td>

<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Insert" id="Insert" value="Insert" alt="Insert" src="../../../WA_DataAssist/images/Pacifica/Refined_insert.gif" /></td>
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="">

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...