View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How do you make a Dynamic Form auto populate fields?

Thread began 7/31/2009 12:11 pm by tom92909 | Last modified 7/31/2009 2:01 pm by tom92909 | 2997 views | 3 replies

tom92909Beta Tester

How do you make a Dynamic Form auto populate fields?

I am using PHP and mySQL.

I have a fully functional DataAssist Insert form that inserts records into a mySQL table.

For the first two inputs on the form, I have separate dynamic combo boxes that read from 2 separate recordsets. These queries look for specific information from different tables. If the 1st combo box selection is chosen, it will change the options in the second combo box. When the 2nd combo box is selected, the data that is chosen will dynamically determine what will auto populate the remaining text boxes with initial values. The remaining form fields will not have initial values until the 2nd combo box is selected.

1st Combo Box to get the Name for Table1

<select size="1" id="name" name="name">
<option value="-1" selected>Not Selected</option>
<?php
do {
?>
<option value="<?php echo $row_getTable1['record_id']; ?>"><?php echo $row_getTable1['name']; ?></option>
<?php
} while ($row_getTable1 = mysql_fetch_assoc($getTable1));
$rows = mysql_num_rows($getTable1);
if($rows > 0) {
mysql_data_seek($getTable1, 0);
$row_getTable1 = mysql_fetch_assoc($getTable1);
}
?>
</select>



2nd Combo Box to get the Department for Table2

<select size="1" id="department" name="department">
<option value="-1" selected>Not Selected</option>
<?php
do {
?>
<option value="<?php echo $row_getTable2['record_id']; ?>"><?php echo $row_getTable2['department']; ?></option>
<?php
} while ($row_getTable2 = mysql_fetch_assoc($getTable2));
$rows = mysql_num_rows($getTable2);
if($rows > 0) {
mysql_data_seek($getTable2, 0);
$row_getTable2 = mysql_fetch_assoc($getTable2);
}
?>
</select>



How is this accomplished?

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

Content

rating

Layout

rating

Ease of use

rating

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