close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Query regarding List/Combo Boxes and additional fields into text fields?

Thread began 1/02/2021 2:00 pm by anonymous | Last modified 1/04/2021 9:16 am by Ray Borduin | 186 views | 1 replies |

anonymous

Query regarding List/Combo Boxes and additional fields into text fields?

Hi,

I've currently got a webpage that runs a query in my database using variables from the URL to populate a list box. The query brings back a list of locations:

Location 1
Location 2
Location 3

The actual query does a Select location, block, area, status when it runs:

<?php
$selectloc = new WA_MySQLi_RS("selectloc",$DB,0);
$selectloc->setQuery("SELECT location, block, area, status FROM building WHERE country = ?");
$selectloc->bindParam("s", "".$_GET['country'] ."", "empty");
$selectloc->execute();
?>

It then put the values for location into the list box which is a repeat to get all the options:

<?php
$wa_startindex = 0;
while(!$selectloc->atEnd()) {
$wa_startindex = $selectloc->Index;
?>

<option value="<?php echo ($selectloc->getColumnVal("Location")) ?>"></option>

<?php
$selectloc->moveNext();
}
$selectloc->moveFirst();
unset($wa_startindex);
unset($wa_repeatcount);
?>

What I was trying to do now, since I've been asked, is when the Location is selected, I push the other information, from the other 3 columns (block, area, status) into 3 text boxes on the same page, so if you select Location 1 for example, the text box for block would get filled in with the additional column data for location 1. If you change this to Location 2 it would update them to show the additional column data for location 2 etc.

I've seen lots of different scripts etc but I'm getting totally lost in what I need to do and how to do it with the setup I have and wondered if there was any help or guidance you could give me??

Regards
Alan

Sign in to reply to this post

anonymous

Hi,

I'm sorry! Just after posting my query I found the following:

http://www.webassist.com/forums/posts.php?id=28540 (Populating text fields from dropdown)

Must look harder next time, but using the example in there that you provided, I've just had a quick look and got it working with my data so I'm going to have a look tomorrow and tidy up my code and page and hopefully fingers crossed I've got it all working.

Always nice to have a satisfying end to a day :)

Sorry for the wasted post !

Regards
Alan

Sign in to reply to this post

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