Question on from submit using a java populate?

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 28, 2013   (RSS)

By nmsinc - January 26, 2013

I'm using a java based populate script below that populates a box upon the choice of a company option. The form submit returns two values, one based on company number and one based on user number. I only need the value of the user number returned on submit. The problem - I need the company number to lookup the user number therefore I cannot "null" this choice!

Any help or suggestions?

--------------------------------------------------Populate Script---------------------------------------

<?php
  require_once("cmsAdmin/lib/viewer_functions.php");
 
  if (@$_REQUEST['target'] == "insurance") {
    $user_type = "Adjuster";
    $user_type2 = "Dispatcher/Adjuster";
    $user_type3 = "Dispatcher";
  }
  else {
    $user_type = "Adjuster";
    $user_type2 = "Dispatcher/Adjuster";
    $user_type3 = "Dispatcher";
  }
  
  $adjusterRecords = mysql_select("accounts", "member_company_accounts = '".intval(@$_REQUEST['company'])."' AND disabled = 'No' AND user_type IN('$user_type', '$user_type2', '$user_type3') ORDER BY fullname");
?>

<option value = "">--- Select ---</option>
<?php foreach ($adjusterRecords as $record): ?>
  <option value = "<?php echo $record['num'];?>"><?php echo $record['fullname'];?></option>
<?php endforeach ?>

------------------------------------------------------------------ form which uses the populate script above-------------------------------------------------------

<form action="user-profile-admin-update.php?" method="post">
         Insurance Company:
       <select name="member_company" onchange = "populateAdjusterList(this, 'insurance');">
       <option value="">--- Select ---</option>
       <?php foreach (mysql_select("member_companies", "member_type = 'Insurance' ORDER BY member_company_name") as $insurance): ?>
       <?php if ($CURRENT_USER['member_company_accounts'] == $insurance['assigned_by_independent'] OR $insurance['accepts_all_indepedents'] == "Yes"): ?>
       <option value = "<?php echo $insurance['num'];?>"><?php echo $insurance['member_company_name'];?> - <?php echo $insurance['city'];?> <?php echo $insurance['state'];?></option>
       <?php endif; ?>
       <?php endforeach ?>
                            </select>
       &nbsp;

       
        <select name="num" id = "insurance">
        <option value="">--- Select ---</option>
       </select>
       <input type="submit" value="Edit User Profile"></font></font></td>

nmsinc