The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dropdown box auto populates other input fields - Help
#8
Do you require the fields to be seen by the user? If you use the dropdown to display the information to the user, e.g. $company -> $firstname $lastname, and then in the post you can run
Code:
SELECT * FROM permsOp where company = ?, array($company)
.

So in your post:
Code:
$company = Input::get('company');
Code:
$Q = $db->query("SELECT * FROM tablename WHERE company = ?,array($company));
Code:
$result = $Q->first();
Code:
$firstname = $result->firstname;
Code:
$lastname = $result->lastname;

Basically this will take the value of your select, which you seem to have figured out, then when you POST, it will populate the first and last name by grabbing the value from the table.

If you need the user to see the values, I will see what I can pull together for ya. But I think if they don't need to edit it, why do they need to see it before the form is submitted?
  Reply


Messages In This Thread
Dropdown box auto populates other input fields - Help - by Brandin - 04-29-2017, 05:48 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)