Ask your WordPress questions! Pay money and get answers fast! (more info)

Custom Profile Fields Error Checking Based On Role WordPress

  • SOLVED

The basic logic is this;

Depending on the role you have registered (s2member_Level1) or (s2member_Level2) you will see different custom profile fields that require updating... Most of these fields being mandatory...

As most fields are mandatory there is some logic to validate fields and return errors when fields have not been completed...

Everything works fine apart from the error messaging... The problem I am encountering is this;

If you login as a s2member_level1 user and complete all the required custom profile fields, it will not save successfully as it reports that the s2member_level2 fields (which are not shown to a s2member_level1 user) have not been completed...

Basically I need some logic to say only run the error logic below for the correct user role... i.e. if the user is a s2member_level1 then only apply the s2member_level1 error logic and similarly if the user is a s2member_level2 then only apply the s2member_level2 error logic...

Code example below;

Many Thanks,
Sean.

<code>// add error checking for required fields

add_action( 'user_profile_update_errors', 'validate_field' );

function validate_field(&$errors, $update = null, &$user = null)

{

if ($_POST['business_name']=='' or $_POST['business_name']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_business_name', "ERROR: Please enter your BUSINESS name.");
}

if ($_POST['brand_desc']=='' or $_POST['brand_desc']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_brand_desc', "ERROR: Please enter your BRAND description.");
}
if ($_POST['industry']=='' or $_POST['industry']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_industry', "ERROR: Please select a valid INDUSTRY value.");
}
if ($_POST['exp_years']=='' or $_POST['exp_years']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_exp_years', "ERROR: Please select a valid YEARS OF EXPERIENCE value.");
}
if ($_POST['education']=='' or $_POST['education']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_education', "ERROR: Please select a valid EDUCATION value.");
}
if ($_POST['state']=='' or $_POST['state']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_state', "ERROR: Please select a valid STATE value.");
}
if ($_POST['emp_status']=='' or $_POST['emp_status']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_emp_status', "ERROR: Please select a valid EMPLOYMENT STATUS value.");
}
if ($_POST['seeking_one']=='' or $_POST['seeking_one']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_seeking_one', "ERROR: Please select a valid SEEKING POSITION 1 value.");
}
if ($_POST['seeking_two']=='' or $_POST['seeking_two']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_seeking_two', "ERROR: Please select a valid SEEKING POSITION 2 value.");
}
if ($_POST['work_type']=='' or $_POST['work_type']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_work_type', "ERROR: Please select a valid WORK TYPE value.");
}

}



// add custom fields to profile

add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );

function my_show_extra_profile_fields($user) {?>

<?php if($user->has_cap('s2member_level2')) { // Custom fields only display to business accounts?>

<h3>Your Company Details</h3>

<table class="form-table">

<tr>

<th><label for="age">Business Name</label>
</th>
<td><input type="text" name="business_name" id="business_name" required value="<?php echo esc_attr(get_the_author_meta( 'business_name', $user->ID ) ); ?>" class="regular-text" /> <br />
<span class="description">Please enter your age. <strong>(Required)</strong></span>
</td>
</tr>


</table>

<?php } if($user->has_cap('s2member_level1')) {// Custom fields only display to Level 1 accounts?>

<h3>Your Personal Brand</h3>

<table class="form-table">

<tr>

<th><label for="brand_desc">Bio Description</label>
</th>
<td>

<textarea name="brand_desc" id="brand_desc" style="width:100%;" class="regular-text" rows="8" cols="30"/><?php echo esc_attr(get_the_author_meta( 'brand_desc', $user->ID ) ); ?></textarea><br />
<span class="description">Please enter your bio description. <strong>(Required)</strong></span>
</td>
</tr>



<tr>
<th><label for="industry">Current Industry</label></th>
<td>
<?php
//get dropdown saved value
$selected = get_the_author_meta( 'industry', $user->ID );
?>
<select name="industry" id="industry" style="width:100%;">
<option value=""></option>
<option value="Administration &amp; Office Support" <?php echo ($selected == "Administration & Office Support")? 'selected="selected"' : '' ?>>Administration &amp; Office Support</option>
<option value="Advertising &amp; Arts" <?php echo ($selected == "Advertising & Arts")? 'selected="selected"' : '' ?>>Advertising &amp; Arts</option>
<option value="Architecture &amp; Design" <?php echo ($selected == "Architecture & Design")? 'selected="selected"' : '' ?>>Architecture &amp; Design</option>
<option value="Banking Services" <?php echo ($selected == "Banking Services")? 'selected="selected"' : '' ?>>Banking Services</option>
<option value="Board Member (Executive / Non Executive)" <?php echo ($selected == "Board Member (Executive / Non Executive)")? 'selected="selected"' : '' ?>>Board Member (Executive / Non Executive)</option>
<option value="Building &amp; Construction" <?php echo ($selected == "Building & Construction")? 'selected="selected"' : '' ?>>Building &amp; Construction</option>
<option value="CEO &amp; General Management" <?php echo ($selected == "CEO & General Management")? 'selected="selected"' : '' ?>>CEO &amp; General Management</option>
<option value="Community Services" <?php echo ($selected == "Community Services")? 'selected="selected"' : '' ?>>Community Services</option>
<option value="Consulting &amp; Strategy" <?php echo ($selected == "Consulting & Strategy")? 'selected="selected"' : '' ?>>Consulting &amp; Strategy</option>
<option value="Customer Service &amp; Call Centre" <?php echo ($selected == "Customer Service & Call Centre")? 'selected="selected"' : '' ?>>Customer Service &amp; Call Centre</option>
<option value="Distribution &amp; Warehousing" <?php echo ($selected == "Distribution & Warehousing")? 'selected="selected"' : '' ?>>Distribution &amp; Warehousing</option>
<option value="Early Childhood &amp; Education" <?php echo ($selected == "Early Childhood & Education")? 'selected="selected"' : '' ?>>Early Childhood &amp; Education</option>
<option value="Emergency Management" <?php echo ($selected == "Emergency Management")? 'selected="selected"' : '' ?>>Emergency Management</option>
<option value="Engineering" <?php echo ($selected == "Engineering")? 'selected="selected"' : '' ?>>Engineering</option>
<option value="Environmental Services" <?php echo ($selected == "Environmental Services")? 'selected="selected"' : '' ?>>Environmental Services</option>
<option value="Financial Services &amp; Accounting" <?php echo ($selected == "Financial Services & Accounting")? 'selected="selected"' : '' ?>>Financial Services &amp; Accounting</option>
<option value="FMCG" <?php echo ($selected == "FMCG")? 'selected="selected"' : '' ?>>FMCG</option>
<option value="Health Care &amp; Services" <?php echo ($selected == "Health Care & Services")? 'selected="selected"' : '' ?>>Health Care &amp; Services</option>
<option value="Hospitality" <?php echo ($selected == "Hospitality")? 'selected="selected"' : '' ?>>Hospitality</option>
<option value="Human Resources" <?php echo ($selected == "Human Resources")? 'selected="selected"' : '' ?>>Human Resources</option>
<option value="Insurance Services" <?php echo ($selected == "Insurance Services")? 'selected="selected"' : '' ?>>Insurance Services</option>
<option value="IT &amp; Telecommunications" <?php echo ($selected == "IT & Telecommunications")? 'selected="selected"' : '' ?>>IT &amp; Telecommunications</option>
<option value="Legal Services" <?php echo ($selected == "Legal Services")? 'selected="selected"' : '' ?>>Legal Services</option>
<option value="Local Government" <?php echo ($selected == "Local Government")? 'selected="selected"' : '' ?>>Local Government</option>
<option value="Manufacturing" <?php echo ($selected == "Manufacturing")? 'selected="selected"' : '' ?>>Manufacturing</option>
<option value="Marketing" <?php echo ($selected == "Marketing")? 'selected="selected"' : '' ?>>Marketing</option>
<option value="Media &amp; Public Relations" <?php echo ($selected == "Media & Public Relations")? 'selected="selected"' : '' ?>>Media &amp; Public Relations</option>
<option value="Mining, Resources &amp; Energy" <?php echo ($selected == "Mining, Resources & Energy")? 'selected="selected"' : '' ?>>Mining, Resources &amp; Energy</option>
<option value="Not For Profit" <?php echo ($selected == "Not For Profit")? 'selected="selected"' : '' ?>>Not For Profit</option>
<option value="OHS &amp; Workers Compensation" <?php echo ($selected == "OHS & Workers Compensation")? 'selected="selected"' : '' ?>>OHS &amp; Workers Compensation</option>
<option value="Performing Arts" <?php echo ($selected == "Performing Arts")? 'selected="selected"' : '' ?>>Performing Arts</option>
<option value="Real Estate &amp; Property Development" <?php echo ($selected == "Real Estate & Property Development")? 'selected="selected"' : '' ?>>Real Estate &amp; Property Development</option>
<option value="Recruitment &amp; Sourcing" <?php echo ($selected == "Recruitment & Sourcing")? 'selected="selected"' : '' ?>>Recruitment &amp; Sourcing</option>
<option value="Risk Management" <?php echo ($selected == "Risk Management")? 'selected="selected"' : '' ?>>Risk Management</option>
<option value="Sales &amp; Retail" <?php echo ($selected == "Sales & Retail")? 'selected="selected"' : '' ?>>Sales &amp; Retail</option>
<option value="Self Employed" <?php echo ($selected == "Self Employed")? 'selected="selected"' : '' ?>>Self Employed</option>
<option value="Social Media" <?php echo ($selected == "Social Media")? 'selected="selected"' : '' ?>>Social Media</option>
<option value="Training &amp; Development" <?php echo ($selected == "Training & Development")? 'selected="selected"' : '' ?>>Training &amp; Development</option>
<option value="Travel &amp; Tourism" <?php echo ($selected == "Travel & Tourism")? 'selected="selected"' : '' ?>>Travel &amp; Tourism</option>
<option value="Transport &amp; Logistics" <?php echo ($selected == "Transport & Logistics")? 'selected="selected"' : '' ?>>Transport &amp; Logistics</option>
<option value="Volunteer" <?php echo ($selected == "Volunteer")? 'selected="selected"' : '' ?>>Volunteer</option>


</select>


<span class="description">Your current industry. <strong>(Required)</strong></span>
</td>
</tr>

<tr>
<th><label for="exp_years">Years Of Experience</label></th>
<td>
<?php
//get dropdown saved value
$selected = get_the_author_meta( 'exp_years', $user->ID );
?>
<select name="exp_years" id="exp_years" style="width:100%;">
<option value=""></option>
<option value="Less than 1 year" <?php echo ($selected == "Less than 1 year")? 'selected="selected"' : '' ?>>Less than 1 year</option>
<option value="1-3 years" <?php echo ($selected == "1-3 years")? 'selected="selected"' : '' ?>>1-3 years</option>
<option value="4-7 years" <?php echo ($selected == "4-7 years")? 'selected="selected"' : '' ?>>4-7 years</option>
<option value="8-15 years" <?php echo ($selected == "8-15 years")? 'selected="selected"' : '' ?>>8-15 years</option>
<option value="15+ years" <?php echo ($selected == "15+ years")? 'selected="selected"' : '' ?>>15+ years</option>
</select>

<span class="description">Years of experience. <strong>(Required)</strong></span>
</td>
</tr>



<tr>
<th><label for="education">Education</label></th>
<td>
<?php
//get dropdown saved value
$selected = get_the_author_meta( 'education', $user->ID );
?>
<select name="education" id="education" style="width:100%;">
<option value=""></option>
<option value="VCE" <?php echo ($selected == "VCE")? 'selected="selected"' : '' ?>>VCE</option>
<option value="Certificate / Diploma" <?php echo ($selected == "Certificate / Diploma")? 'selected="selected"' : '' ?>>Certificate / Diploma</option>
<option value="Under Graduate" <?php echo ($selected == "Under Graduate")? 'selected="selected"' : '' ?>>Under Graduate</option>
<option value="Post Graduate" <?php echo ($selected == "Post Graduate")? 'selected="selected"' : '' ?>>Post Graduate</option>
<option value="Other" <?php echo ($selected == "Other")? 'selected="selected"' : '' ?>>Other</option>
</select>

<span class="description">Your education level. <strong>(Required)</strong></span>
</td>
</tr>


<tr>
<th><label for="location">Location</label></th>
<td>
<?php
//get dropdown saved value
$selected = get_the_author_meta( 'state', $user->ID );
?>
<select name="state" id="state" style="width:100%;">
<option value=""></option>
<option value="New South Wales" <?php echo ($selected == "New South Wales")? 'selected="selected"' : '' ?>>New South Wales</option>
<option value="Western Australia" <?php echo ($selected == "Western Australia")? 'selected="selected"' : '' ?>>Western Australia</option>
<option value="Victoria" <?php echo ($selected == "Victoria")? 'selected="selected"' : '' ?>>Victoria</option>
<option value="South Australia" <?php echo ($selected == "South Australia")? 'selected="selected"' : '' ?>>South Australia</option>
<option value="Queensland" <?php echo ($selected == "Queensland")? 'selected="selected"' : '' ?>>Queensland</option>
<option value="Northern Territory" <?php echo ($selected == "Northern Territory")? 'selected="selected"' : '' ?>>Northern Territory</option>
<option value="Australian Capital Territory" <?php echo ($selected == "Australian Capital Territory")? 'selected="selected"' : '' ?>>Australian Capital Territory</option>
<option value="Tasmania" <?php echo ($selected == "Tasmania")? 'selected="selected"' : '' ?>>Tasmania</option>
</select>

<span class="description">Your residential state or territory. <strong>(Required)</strong></span>
</td>
</tr>

<tr>
<th><label for="status">My Current Status</label></th>
<td>
<?php
//get dropdown saved value
$selected = get_the_author_meta( 'emp_status', $user->ID );
?>
<select name="emp_status" id="emp_status" style="width:100%;">
<option value=""></option>
<option value="Yes" <?php echo ($selected == "Yes")? 'selected="selected"' : '' ?>>Actively seeking next role</option>
<option value="No" <?php echo ($selected == "No")? 'selected="selected"' : '' ?>>Not actively seeking next role</option>
</select>

<span class="description">Your current job seeking status. <strong>(Required)</strong></span>
</td>
</tr>

<tr>
<th><label for="seeking_one">Position Seeking 1</label></th>
<td>
<?php
//get dropdown saved value
$selected = get_the_author_meta( 'seeking_one', $user->ID );
?>
<select name="seeking_one" id="seeking_one" style="width:100%;">
<option value=""></option>
<option value="Account Director " <?php echo ($selected == "Account Director ")? 'selected=selected' : '' ?>>Account Director </option>
<option value="Account Executive" <?php echo ($selected == "Account Executive")? 'selected=selected' : '' ?>>Account Executive</option>
<option value="Account Manager" <?php echo ($selected == "Account Manager")? 'selected=selected' : '' ?>>Account Manager</option>
<option value="Accounts Payable" <?php echo ($selected == "Accounts Payable")? 'selected=selected' : '' ?>>Accounts Payable</option>
<option value="Accounts Receivable" <?php echo ($selected == "Accounts Receivable")? 'selected=selected' : '' ?>>Accounts Receivable</option>
<option value="Accountancy / CPA" <?php echo ($selected == "Accountancy / CPA")? 'selected=selected' : '' ?>>Accountancy / CPA</option>
<option value="Accountancy / no CPA" <?php echo ($selected == "Accountancy / no CPA")? 'selected=selected' : '' ?>>Accountancy / no CPA</option>
<option value="Administrative Assistant" <?php echo ($selected == "Administrative Assistant")? 'selected=selected' : '' ?>>Administrative Assistant</option>
<option value="Administrative Officer" <?php echo ($selected == "Administrative Officer")? 'selected=selected' : '' ?>>Administrative Officer</option>
<option value="Aged Care Worker" <?php echo ($selected == "Aged Care Worker")? 'selected=selected' : '' ?>>Aged Care Worker</option>
<option value="Architect" <?php echo ($selected == "Architect")? 'selected=selected' : '' ?>>Architect</option>
<option value="Art Director" <?php echo ($selected == "Art Director")? 'selected=selected' : '' ?>>Art Director</option>
<option value="Auditor" <?php echo ($selected == "Auditor")? 'selected=selected' : '' ?>>Auditor</option>
<option value="Auditor - Senior" <?php echo ($selected == "Auditor - Senior")? 'selected=selected' : '' ?>>Auditor - Senior</option>
<option value="Banking roles" <?php echo ($selected == "Banking roles")? 'selected=selected' : '' ?>>Banking roles</option>
<option value="Bookkeeper" <?php echo ($selected == "Bookkeeper")? 'selected=selected' : '' ?>>Bookkeeper</option>
<option value="Business Development Manager" <?php echo ($selected == "Business Development Manager")? 'selected=selected' : '' ?>>Business Development Manager</option>
<option value="Business Services" <?php echo ($selected == "Business Services")? 'selected=selected' : '' ?>>Business Services</option>
<option value="CAD Operator" <?php echo ($selected == "CAD Operator")? 'selected=selected' : '' ?>>CAD Operator</option>
<option value="Care Worker" <?php echo ($selected == "Care Worker")? 'selected=selected' : '' ?>>Care Worker</option>
<option value="Carpenter" <?php echo ($selected == "Carpenter")? 'selected=selected' : '' ?>>Carpenter</option>
<option value="Category Manager" <?php echo ($selected == "Category Manager")? 'selected=selected' : '' ?>>Category Manager</option>
<option value="CEO / MD roles" <?php echo ($selected == "CEO / MD roles")? 'selected=selected' : '' ?>>CEO / MD roles</option>
<option value="CFO / CIO / COO roles" <?php echo ($selected == "CFO / CIO / COO roles")? 'selected=selected' : '' ?>>CFO / CIO / COO roles</option>
<option value="Change Manager" <?php echo ($selected == "Change Manager")? 'selected=selected' : '' ?>>Change Manager</option>
<option value="Chemist" <?php echo ($selected == "Chemist")? 'selected=selected' : '' ?>>Chemist</option>
<option value="Child Care Worker" <?php echo ($selected == "Child Care Worker")? 'selected=selected' : '' ?>>Child Care Worker</option>
<option value="Civil Engineer" <?php echo ($selected == "Civil Engineer")? 'selected=selected' : '' ?>>Civil Engineer</option>
<option value="Claims Manager" <?php echo ($selected == "Claims Manager")? 'selected=selected' : '' ?>>Claims Manager</option>
<option value="Client Relations Manager" <?php echo ($selected == "Client Relations Manager")? 'selected=selected' : '' ?>>Client Relations Manager</option>
<option value="Coach" <?php echo ($selected == "Coach")? 'selected=selected' : '' ?>>Coach</option>
<option value="Commercial Manager" <?php echo ($selected == "Commercial Manager")? 'selected=selected' : '' ?>>Commercial Manager</option>
<option value="Company Secretary" <?php echo ($selected == "Company Secretary")? 'selected=selected' : '' ?>>Company Secretary</option>
<option value="Computer Engineer" <?php echo ($selected == "Computer Engineer")? 'selected=selected' : '' ?>>Computer Engineer</option>
<option value="Consulting roles" <?php echo ($selected == "Consulting roles")? 'selected=selected' : '' ?>>Consulting roles</option>
<option value="Copywriter" <?php echo ($selected == "Copywriter")? 'selected=selected' : '' ?>>Copywriter</option>
<option value="Cost Accountant" <?php echo ($selected == "Cost Accountant")? 'selected=selected' : '' ?>>Cost Accountant</option>
<option value="Credit Manager" <?php echo ($selected == "Credit Manager")? 'selected=selected' : '' ?>>Credit Manager</option>
<option value="Customer Service Manager" <?php echo ($selected == "Customer Service Manager")? 'selected=selected' : '' ?>>Customer Service Manager</option>
<option value="Customer Service Officer" <?php echo ($selected == "Customer Service Officer")? 'selected=selected' : '' ?>>Customer Service Officer</option>
<option value="Database Administrator" <?php echo ($selected == "Database Administrator")? 'selected=selected' : '' ?>>Database Administrator</option>
<option value="Design Engineer" <?php echo ($selected == "Design Engineer")? 'selected=selected' : '' ?>>Design Engineer</option>
<option value="Desktop Publisher" <?php echo ($selected == "Desktop Publisher")? 'selected=selected' : '' ?>>Desktop Publisher</option>
<option value="E-Learning Facilitator" <?php echo ($selected == "E-Learning Facilitator")? 'selected=selected' : '' ?>>E-Learning Facilitator</option>
<option value="Economist" <?php echo ($selected == "Economist")? 'selected=selected' : '' ?>>Economist</option>
<option value="Editing &amp; Publishing roles" <?php echo ($selected == "Editing & Publishing roles")? 'selected=selected' : '' ?>>Editing &amp; Publishing roles</option>
<option value="Electrical Engineer" <?php echo ($selected == "Electrical Engineer")? 'selected=selected' : '' ?>>Electrical Engineer</option>
<option value="Emergency Services" <?php echo ($selected == "Emergency Services")? 'selected=selected' : '' ?>>Emergency Services</option>
<option value="Employee Benefits Manager" <?php echo ($selected == "Employee Benefits Manager")? 'selected=selected' : '' ?>>Employee Benefits Manager</option>
<option value="Employee Relations Manager" <?php echo ($selected == "Employee Relations Manager")? 'selected=selected' : '' ?>>Employee Relations Manager</option>
<option value="Environmental Engineer" <?php echo ($selected == "Environmental Engineer")? 'selected=selected' : '' ?>>Environmental Engineer</option>
<option value="Environmental Manager" <?php echo ($selected == "Environmental Manager")? 'selected=selected' : '' ?>>Environmental Manager</option>
<option value="Event Management" <?php echo ($selected == "Event Management")? 'selected=selected' : '' ?>>Event Management</option>
<option value="Executive Assistant" <?php echo ($selected == "Executive Assistant")? 'selected=selected' : '' ?>>Executive Assistant</option>
<option value="Facilities Manager" <?php echo ($selected == "Facilities Manager")? 'selected=selected' : '' ?>>Facilities Manager</option>
<option value="Financial Analyst" <?php echo ($selected == "Financial Analyst")? 'selected=selected' : '' ?>>Financial Analyst</option>
<option value="Financial Controller" <?php echo ($selected == "Financial Controller")? 'selected=selected' : '' ?>>Financial Controller</option>
<option value="Finished Artist" <?php echo ($selected == "Finished Artist")? 'selected=selected' : '' ?>>Finished Artist</option>
<option value="Fitness Trainer" <?php echo ($selected == "Fitness Trainer")? 'selected=selected' : '' ?>>Fitness Trainer</option>
<option value="Financial Planning &amp; Analysis Manager" <?php echo ($selected == "Financial Planning & Analysis Manager")? 'selected=selected' : '' ?>>Financial Planning &amp; Analysis Manager</option>
<option value="GM / Senior Management roles" <?php echo ($selected == "GM / Senior Management roles")? 'selected=selected' : '' ?>>GM / Senior Management roles</option>
<option value="Government - Federal" <?php echo ($selected == "Government - Federal")? 'selected=selected' : '' ?>>Government - Federal</option>
<option value="Government - Local" <?php echo ($selected == "Government - Local")? 'selected=selected' : '' ?>>Government - Local</option>
<option value="Government - State" <?php echo ($selected == "Government - State")? 'selected=selected' : '' ?>>Government - State</option>
<option value="Graphic Designer" <?php echo ($selected == "Graphic Designer")? 'selected=selected' : '' ?>>Graphic Designer</option>
<option value="Group Account Director" <?php echo ($selected == "Group Account Director")? 'selected=selected' : '' ?>>Group Account Director</option>
<option value="Help Desk Support - IT" <?php echo ($selected == "Help Desk Support - IT")? 'selected=selected' : '' ?>>Help Desk Support - IT</option>
<option value="HR Advisor" <?php echo ($selected == "HR Advisor")? 'selected=selected' : '' ?>>HR Advisor</option>
<option value="HR Assistant" <?php echo ($selected == "HR Assistant")? 'selected=selected' : '' ?>>HR Assistant</option>
<option value="HR Director role" <?php echo ($selected == "HR Director role")? 'selected=selected' : '' ?>>HR Director role</option>
<option value="HR Generalist" <?php echo ($selected == "HR Generalist")? 'selected=selected' : '' ?>>HR Generalist</option>
<option value="HR Manager" <?php echo ($selected == "HR Manager")? 'selected=selected' : '' ?>>HR Manager</option>
<option value="HR Officer" <?php echo ($selected == "HR Officer")? 'selected=selected' : '' ?>>HR Officer</option>
<option value="Industrial Relations Manager" <?php echo ($selected == "Industrial Relations Manager")? 'selected=selected' : '' ?>>Industrial Relations Manager</option>
<option value="Interior Decorator" <?php echo ($selected == "Interior Decorator")? 'selected=selected' : '' ?>>Interior Decorator</option>
<option value="Interior Designer" <?php echo ($selected == "Interior Designer")? 'selected=selected' : '' ?>>Interior Designer</option>
<option value="Internal Recruitment roles" <?php echo ($selected == "Internal Recruitment roles")? 'selected=selected' : '' ?>>Internal Recruitment roles</option>
<option value="IT ManagerIT Manager" <?php echo ($selected == "IT ManagerIT Manager")? 'selected=selected' : '' ?>>IT ManagerIT Manager</option>
<option value="IT Sales" <?php echo ($selected == "IT Sales")? 'selected=selected' : '' ?>>IT Sales</option>
<option value="Journalism" <?php echo ($selected == "Journalism")? 'selected=selected' : '' ?>>Journalism</option>
<option value="Landscape Architect" <?php echo ($selected == "Landscape Architect")? 'selected=selected' : '' ?>>Landscape Architect</option>
<option value="Learning &amp; Organisational Development Manager" <?php echo ($selected == "Learning & Organisational Development Manager")? 'selected=selected' : '' ?>>Learning &amp; Organisational Development Manager</option>
<option value="Logistics Manager" <?php echo ($selected == "Logistics Manager")? 'selected=selected' : '' ?>>Logistics Manager</option>
<option value="Management Accountant" <?php echo ($selected == "Management Accountant")? 'selected=selected' : '' ?>>Management Accountant</option>
<option value="Marketing Manager" <?php echo ($selected == "Marketing Manager")? 'selected=selected' : '' ?>>Marketing Manager</option>
<option value="Marketing Officer" <?php echo ($selected == "Marketing Officer")? 'selected=selected' : '' ?>>Marketing Officer</option>
<option value="Mechanical Engineer" <?php echo ($selected == "Mechanical Engineer")? 'selected=selected' : '' ?>>Mechanical Engineer</option>
<option value="National Account Manager" <?php echo ($selected == "National Account Manager")? 'selected=selected' : '' ?>>National Account Manager</option>
<option value="Network &amp; Systems Administrator - IT" <?php echo ($selected == "Network & Systems Administrator - IT")? 'selected=selected' : '' ?>>Network &amp; Systems Administrator - IT</option>
<option value="Office Manager" <?php echo ($selected == "Office Manager")? 'selected=selected' : '' ?>>Office Manager</option>
<option value="OHS Manager" <?php echo ($selected == "OHS Manager")? 'selected=selected' : '' ?>>OHS Manager</option>
<option value="OHS Officer" <?php echo ($selected == "OHS Officer")? 'selected=selected' : '' ?>>OHS Officer</option>
<option value="Operations Manager" <?php echo ($selected == "Operations Manager")? 'selected=selected' : '' ?>>Operations Manager</option>
<option value="Payroll Manager" <?php echo ($selected == "Payroll Manager")? 'selected=selected' : '' ?>>Payroll Manager</option>
<option value="Payroll Officer" <?php echo ($selected == "Payroll Officer")? 'selected=selected' : '' ?>>Payroll Officer</option>
<option value="People &amp; Culture Manager" <?php echo ($selected == "People & Culture Manager")? 'selected=selected' : '' ?>>People &amp; Culture Manager</option>
<option value="Performing Arts" <?php echo ($selected == "Performing Arts")? 'selected=selected' : '' ?>>Performing Arts</option>
<option value="Pharmacist" <?php echo ($selected == "Pharmacist")? 'selected=selected' : '' ?>>Pharmacist</option>
<option value="Physician" <?php echo ($selected == "Physician")? 'selected=selected' : '' ?>>Physician</option>
<option value="Print Producer" <?php echo ($selected == "Print Producer")? 'selected=selected' : '' ?>>Print Producer</option>
<option value="Procurement Manager" <?php echo ($selected == "Procurement Manager")? 'selected=selected' : '' ?>>Procurement Manager</option>
<option value="Product Manager" <?php echo ($selected == "Product Manager")? 'selected=selected' : '' ?>>Product Manager</option>
<option value="Production Manager" <?php echo ($selected == "Production Manager")? 'selected=selected' : '' ?>>Production Manager</option>
<option value="Project Engineering" <?php echo ($selected == "Project Engineering")? 'selected=selected' : '' ?>>Project Engineering</option>
<option value="Project Management - Retail" <?php echo ($selected == "Project Management - Retail")? 'selected=selected' : '' ?>>Project Management - Retail</option>
<option value="Project Management - Construction" <?php echo ($selected == "Project Management - Construction")? 'selected=selected' : '' ?>>Project Management - Construction</option>
<option value="Purchasing Manager" <?php echo ($selected == "Purchasing Manager")? 'selected=selected' : '' ?>>Purchasing Manager</option>
<option value="Psychologist" <?php echo ($selected == "Psychologist")? 'selected=selected' : '' ?>>Psychologist</option>
<option value="Quality &amp; Assurance" <?php echo ($selected == "Quality & Assurance")? 'selected=selected' : '' ?>>Quality &amp; Assurance</option>
<option value="Real Estate Agent" <?php echo ($selected == "Real Estate Agent")? 'selected=selected' : '' ?>>Real Estate Agent</option>
<option value="Receptionist" <?php echo ($selected == "Receptionist")? 'selected=selected' : '' ?>>Receptionist</option>
<option value="Records Management" <?php echo ($selected == "Records Management")? 'selected=selected' : '' ?>>Records Management</option>
<option value="Recruitment Manager" <?php echo ($selected == "Recruitment Manager")? 'selected=selected' : '' ?>>Recruitment Manager</option>
<option value="Regional Manager" <?php echo ($selected == "Regional Manager")? 'selected=selected' : '' ?>>Regional Manager</option>
<option value="Registered Nurse" <?php echo ($selected == "Registered Nurse")? 'selected=selected' : '' ?>>Registered Nurse</option>
<option value="Remuneration Manager" <?php echo ($selected == "Remuneration Manager")? 'selected=selected' : '' ?>>Remuneration Manager</option>
<option value="Retail Manager" <?php echo ($selected == "Retail Manager")? 'selected=selected' : '' ?>>Retail Manager</option>
<option value="Retoucher" <?php echo ($selected == "Retoucher")? 'selected=selected' : '' ?>>Retoucher</option>
<option value="Risk Management" <?php echo ($selected == "Risk Management")? 'selected=selected' : '' ?>>Risk Management</option>
<option value="Sales Director" <?php echo ($selected == "Sales Director")? 'selected=selected' : '' ?>>Sales Director</option>
<option value="Sales Event Coordinator" <?php echo ($selected == "Sales Event Coordinator")? 'selected=selected' : '' ?>>Sales Event Coordinator</option>
<option value="Sales ManagerSales Manager" <?php echo ($selected == "Sales ManagerSales Manager")? 'selected=selected' : '' ?>>Sales ManagerSales Manager</option>
<option value="Sales Representative" <?php echo ($selected == "Sales Representative")? 'selected=selected' : '' ?>>Sales Representative</option>
<option value="Secretary" <?php echo ($selected == "Secretary")? 'selected=selected' : '' ?>>Secretary</option>
<option value="Senior Account Director" <?php echo ($selected == "Senior Account Director")? 'selected=selected' : '' ?>>Senior Account Director</option>
<option value="Senior Account Manager" <?php echo ($selected == "Senior Account Manager")? 'selected=selected' : '' ?>>Senior Account Manager</option>
<option value="Social Media roles" <?php echo ($selected == "Social Media roles")? 'selected=selected' : '' ?>>Social Media roles</option>
<option value="Software Developer" <?php echo ($selected == "Software Developer")? 'selected=selected' : '' ?>>Software Developer</option>
<option value="Studio Manager" <?php echo ($selected == "Studio Manager")? 'selected=selected' : '' ?>>Studio Manager</option>
<option value="Systems Architect - IT" <?php echo ($selected == "Systems Architect - IT")? 'selected=selected' : '' ?>>Systems Architect - IT</option>
<option value="Teacher" <?php echo ($selected == "Teacher")? 'selected=selected' : '' ?>>Teacher</option>
<option value="Teachers Aide" <?php echo ($selected == "Teachers Aide")? 'selected=selected' : '' ?>>Teachers Aide</option>
<option value="Team Leader roles" <?php echo ($selected == "Team Leader roles")? 'selected=selected' : '' ?>>Team Leader roles</option>
<option value="Training Manager" <?php echo ($selected == "Training Manager")? 'selected=selected' : '' ?>>Training Manager</option>
<option value="Travel Agent" <?php echo ($selected == "Travel Agent")? 'selected=selected' : '' ?>>Travel Agent</option>
<option value="Urban Planner" <?php echo ($selected == "Urban Planner")? 'selected=selected' : '' ?>>Urban Planner</option>
<option value="Veterinarian" <?php echo ($selected == "Veterinarian")? 'selected=selected' : '' ?>>Veterinarian</option>
<option value="Volunteer roles" <?php echo ($selected == "Volunteer roles")? 'selected=selected' : '' ?>>Volunteer roles</option>
<option value="Warehouse Manager" <?php echo ($selected == "Warehouse Manager")? 'selected=selected' : '' ?>>Warehouse Manager</option>
<option value="Web Developer" <?php echo ($selected == "Web Developer")? 'selected=selected' : '' ?>>Web Developer</option>
<option value="WorkCover Coordinator" <?php echo ($selected == "WorkCover Coordinator")? 'selected=selected' : '' ?>>WorkCover Coordinator</option>
<option value="ZoologistZoologist" <?php echo ($selected == "ZoologistZoologist")? 'selected=selected' : '' ?>>ZoologistZoologist</option>
</select>


<span class="description">Preferred position. <strong>(Required)</strong></span>
</td>
</tr>

<tr>
<th><label for="seeking_two">Position Seeking 2</label></th>
<td>
<?php
//get dropdown saved value
$selected = get_the_author_meta( 'seeking_two', $user->ID );
?>
<select name="seeking_two" id="seeking_two" style="width:100%;">
<option value=""></option>
<option value="Account Director " <?php echo ($selected == "Account Director ")? 'selected=selected' : '' ?>>Account Director </option>
<option value="Account Executive" <?php echo ($selected == "Account Executive")? 'selected=selected' : '' ?>>Account Executive</option>
<option value="Account Manager" <?php echo ($selected == "Account Manager")? 'selected=selected' : '' ?>>Account Manager</option>
<option value="Accounts Payable" <?php echo ($selected == "Accounts Payable")? 'selected=selected' : '' ?>>Accounts Payable</option>
<option value="Accounts Receivable" <?php echo ($selected == "Accounts Receivable")? 'selected=selected' : '' ?>>Accounts Receivable</option>
<option value="Accountancy / CPA" <?php echo ($selected == "Accountancy / CPA")? 'selected=selected' : '' ?>>Accountancy / CPA</option>
<option value="Accountancy / no CPA" <?php echo ($selected == "Accountancy / no CPA")? 'selected=selected' : '' ?>>Accountancy / no CPA</option>
<option value="Administrative Assistant" <?php echo ($selected == "Administrative Assistant")? 'selected=selected' : '' ?>>Administrative Assistant</option>
<option value="Administrative Officer" <?php echo ($selected == "Administrative Officer")? 'selected=selected' : '' ?>>Administrative Officer</option>
<option value="Aged Care Worker" <?php echo ($selected == "Aged Care Worker")? 'selected=selected' : '' ?>>Aged Care Worker</option>
<option value="Architect" <?php echo ($selected == "Architect")? 'selected=selected' : '' ?>>Architect</option>
<option value="Art Director" <?php echo ($selected == "Art Director")? 'selected=selected' : '' ?>>Art Director</option>
<option value="Auditor" <?php echo ($selected == "Auditor")? 'selected=selected' : '' ?>>Auditor</option>
<option value="Auditor - Senior" <?php echo ($selected == "Auditor - Senior")? 'selected=selected' : '' ?>>Auditor - Senior</option>
<option value="Banking roles" <?php echo ($selected == "Banking roles")? 'selected=selected' : '' ?>>Banking roles</option>
<option value="Bookkeeper" <?php echo ($selected == "Bookkeeper")? 'selected=selected' : '' ?>>Bookkeeper</option>
<option value="Business Development Manager" <?php echo ($selected == "Business Development Manager")? 'selected=selected' : '' ?>>Business Development Manager</option>
<option value="Business Services" <?php echo ($selected == "Business Services")? 'selected=selected' : '' ?>>Business Services</option>
<option value="CAD Operator" <?php echo ($selected == "CAD Operator")? 'selected=selected' : '' ?>>CAD Operator</option>
<option value="Care Worker" <?php echo ($selected == "Care Worker")? 'selected=selected' : '' ?>>Care Worker</option>
<option value="Carpenter" <?php echo ($selected == "Carpenter")? 'selected=selected' : '' ?>>Carpenter</option>
<option value="Category Manager" <?php echo ($selected == "Category Manager")? 'selected=selected' : '' ?>>Category Manager</option>
<option value="CEO / MD roles" <?php echo ($selected == "CEO / MD roles")? 'selected=selected' : '' ?>>CEO / MD roles</option>
<option value="CFO / CIO / COO roles" <?php echo ($selected == "CFO / CIO / COO roles")? 'selected=selected' : '' ?>>CFO / CIO / COO roles</option>
<option value="Change Manager" <?php echo ($selected == "Change Manager")? 'selected=selected' : '' ?>>Change Manager</option>
<option value="Chemist" <?php echo ($selected == "Chemist")? 'selected=selected' : '' ?>>Chemist</option>
<option value="Child Care Worker" <?php echo ($selected == "Child Care Worker")? 'selected=selected' : '' ?>>Child Care Worker</option>
<option value="Civil Engineer" <?php echo ($selected == "Civil Engineer")? 'selected=selected' : '' ?>>Civil Engineer</option>
<option value="Claims Manager" <?php echo ($selected == "Claims Manager")? 'selected=selected' : '' ?>>Claims Manager</option>
<option value="Client Relations Manager" <?php echo ($selected == "Client Relations Manager")? 'selected=selected' : '' ?>>Client Relations Manager</option>
<option value="Coach" <?php echo ($selected == "Coach")? 'selected=selected' : '' ?>>Coach</option>
<option value="Commercial Manager" <?php echo ($selected == "Commercial Manager")? 'selected=selected' : '' ?>>Commercial Manager</option>
<option value="Company Secretary" <?php echo ($selected == "Company Secretary")? 'selected=selected' : '' ?>>Company Secretary</option>
<option value="Computer Engineer" <?php echo ($selected == "Computer Engineer")? 'selected=selected' : '' ?>>Computer Engineer</option>
<option value="Consulting roles" <?php echo ($selected == "Consulting roles")? 'selected=selected' : '' ?>>Consulting roles</option>
<option value="Copywriter" <?php echo ($selected == "Copywriter")? 'selected=selected' : '' ?>>Copywriter</option>
<option value="Cost Accountant" <?php echo ($selected == "Cost Accountant")? 'selected=selected' : '' ?>>Cost Accountant</option>
<option value="Credit Manager" <?php echo ($selected == "Credit Manager")? 'selected=selected' : '' ?>>Credit Manager</option>
<option value="Customer Service Manager" <?php echo ($selected == "Customer Service Manager")? 'selected=selected' : '' ?>>Customer Service Manager</option>
<option value="Customer Service Officer" <?php echo ($selected == "Customer Service Officer")? 'selected=selected' : '' ?>>Customer Service Officer</option>
<option value="Database Administrator" <?php echo ($selected == "Database Administrator")? 'selected=selected' : '' ?>>Database Administrator</option>
<option value="Design Engineer" <?php echo ($selected == "Design Engineer")? 'selected=selected' : '' ?>>Design Engineer</option>
<option value="Desktop Publisher" <?php echo ($selected == "Desktop Publisher")? 'selected=selected' : '' ?>>Desktop Publisher</option>
<option value="E-Learning Facilitator" <?php echo ($selected == "E-Learning Facilitator")? 'selected=selected' : '' ?>>E-Learning Facilitator</option>
<option value="Economist" <?php echo ($selected == "Economist")? 'selected=selected' : '' ?>>Economist</option>
<option value="Editing &amp; Publishing roles" <?php echo ($selected == "Editing & Publishing roles")? 'selected=selected' : '' ?>>Editing &amp; Publishing roles</option>
<option value="Electrical Engineer" <?php echo ($selected == "Electrical Engineer")? 'selected=selected' : '' ?>>Electrical Engineer</option>
<option value="Emergency Services" <?php echo ($selected == "Emergency Services")? 'selected=selected' : '' ?>>Emergency Services</option>
<option value="Employee Benefits Manager" <?php echo ($selected == "Employee Benefits Manager")? 'selected=selected' : '' ?>>Employee Benefits Manager</option>
<option value="Employee Relations Manager" <?php echo ($selected == "Employee Relations Manager")? 'selected=selected' : '' ?>>Employee Relations Manager</option>
<option value="Environmental Engineer" <?php echo ($selected == "Environmental Engineer")? 'selected=selected' : '' ?>>Environmental Engineer</option>
<option value="Environmental Manager" <?php echo ($selected == "Environmental Manager")? 'selected=selected' : '' ?>>Environmental Manager</option>
<option value="Event Management" <?php echo ($selected == "Event Management")? 'selected=selected' : '' ?>>Event Management</option>
<option value="Executive Assistant" <?php echo ($selected == "Executive Assistant")? 'selected=selected' : '' ?>>Executive Assistant</option>
<option value="Facilities Manager" <?php echo ($selected == "Facilities Manager")? 'selected=selected' : '' ?>>Facilities Manager</option>
<option value="Financial Analyst" <?php echo ($selected == "Financial Analyst")? 'selected=selected' : '' ?>>Financial Analyst</option>
<option value="Financial Controller" <?php echo ($selected == "Financial Controller")? 'selected=selected' : '' ?>>Financial Controller</option>
<option value="Finished Artist" <?php echo ($selected == "Finished Artist")? 'selected=selected' : '' ?>>Finished Artist</option>
<option value="Fitness Trainer" <?php echo ($selected == "Fitness Trainer")? 'selected=selected' : '' ?>>Fitness Trainer</option>
<option value="Financial Planning &amp; Analysis Manager" <?php echo ($selected == "Financial Planning & Analysis Manager")? 'selected=selected' : '' ?>>Financial Planning &amp; Analysis Manager</option>
<option value="GM / Senior Management roles" <?php echo ($selected == "GM / Senior Management roles")? 'selected=selected' : '' ?>>GM / Senior Management roles</option>
<option value="Government - Federal" <?php echo ($selected == "Government - Federal")? 'selected=selected' : '' ?>>Government - Federal</option>
<option value="Government - Local" <?php echo ($selected == "Government - Local")? 'selected=selected' : '' ?>>Government - Local</option>
<option value="Government - State" <?php echo ($selected == "Government - State")? 'selected=selected' : '' ?>>Government - State</option>
<option value="Graphic Designer" <?php echo ($selected == "Graphic Designer")? 'selected=selected' : '' ?>>Graphic Designer</option>
<option value="Group Account Director" <?php echo ($selected == "Group Account Director")? 'selected=selected' : '' ?>>Group Account Director</option>
<option value="Help Desk Support - IT" <?php echo ($selected == "Help Desk Support - IT")? 'selected=selected' : '' ?>>Help Desk Support - IT</option>
<option value="HR Advisor" <?php echo ($selected == "HR Advisor")? 'selected=selected' : '' ?>>HR Advisor</option>
<option value="HR Assistant" <?php echo ($selected == "HR Assistant")? 'selected=selected' : '' ?>>HR Assistant</option>
<option value="HR Director role" <?php echo ($selected == "HR Director role")? 'selected=selected' : '' ?>>HR Director role</option>
<option value="HR Generalist" <?php echo ($selected == "HR Generalist")? 'selected=selected' : '' ?>>HR Generalist</option>
<option value="HR Manager" <?php echo ($selected == "HR Manager")? 'selected=selected' : '' ?>>HR Manager</option>
<option value="HR Officer" <?php echo ($selected == "HR Officer")? 'selected=selected' : '' ?>>HR Officer</option>
<option value="Industrial Relations Manager" <?php echo ($selected == "Industrial Relations Manager")? 'selected=selected' : '' ?>>Industrial Relations Manager</option>
<option value="Interior Decorator" <?php echo ($selected == "Interior Decorator")? 'selected=selected' : '' ?>>Interior Decorator</option>
<option value="Interior Designer" <?php echo ($selected == "Interior Designer")? 'selected=selected' : '' ?>>Interior Designer</option>
<option value="Internal Recruitment roles" <?php echo ($selected == "Internal Recruitment roles")? 'selected=selected' : '' ?>>Internal Recruitment roles</option>
<option value="IT ManagerIT Manager" <?php echo ($selected == "IT ManagerIT Manager")? 'selected=selected' : '' ?>>IT ManagerIT Manager</option>
<option value="IT Sales" <?php echo ($selected == "IT Sales")? 'selected=selected' : '' ?>>IT Sales</option>
<option value="Journalism" <?php echo ($selected == "Journalism")? 'selected=selected' : '' ?>>Journalism</option>
<option value="Landscape Architect" <?php echo ($selected == "Landscape Architect")? 'selected=selected' : '' ?>>Landscape Architect</option>
<option value="Learning &amp; Organisational Development Manager" <?php echo ($selected == "Learning & Organisational Development Manager")? 'selected=selected' : '' ?>>Learning &amp; Organisational Development Manager</option>
<option value="Logistics Manager" <?php echo ($selected == "Logistics Manager")? 'selected=selected' : '' ?>>Logistics Manager</option>
<option value="Management Accountant" <?php echo ($selected == "Management Accountant")? 'selected=selected' : '' ?>>Management Accountant</option>
<option value="Marketing Manager" <?php echo ($selected == "Marketing Manager")? 'selected=selected' : '' ?>>Marketing Manager</option>
<option value="Marketing Officer" <?php echo ($selected == "Marketing Officer")? 'selected=selected' : '' ?>>Marketing Officer</option>
<option value="Mechanical Engineer" <?php echo ($selected == "Mechanical Engineer")? 'selected=selected' : '' ?>>Mechanical Engineer</option>
<option value="National Account Manager" <?php echo ($selected == "National Account Manager")? 'selected=selected' : '' ?>>National Account Manager</option>
<option value="Network &amp; Systems Administrator - IT" <?php echo ($selected == "Network & Systems Administrator - IT")? 'selected=selected' : '' ?>>Network &amp; Systems Administrator - IT</option>
<option value="Office Manager" <?php echo ($selected == "Office Manager")? 'selected=selected' : '' ?>>Office Manager</option>
<option value="OHS Manager" <?php echo ($selected == "OHS Manager")? 'selected=selected' : '' ?>>OHS Manager</option>
<option value="OHS Officer" <?php echo ($selected == "OHS Officer")? 'selected=selected' : '' ?>>OHS Officer</option>
<option value="Operations Manager" <?php echo ($selected == "Operations Manager")? 'selected=selected' : '' ?>>Operations Manager</option>
<option value="Payroll Manager" <?php echo ($selected == "Payroll Manager")? 'selected=selected' : '' ?>>Payroll Manager</option>
<option value="Payroll Officer" <?php echo ($selected == "Payroll Officer")? 'selected=selected' : '' ?>>Payroll Officer</option>
<option value="People &amp; Culture Manager" <?php echo ($selected == "People & Culture Manager")? 'selected=selected' : '' ?>>People &amp; Culture Manager</option>
<option value="Performing Arts" <?php echo ($selected == "Performing Arts")? 'selected=selected' : '' ?>>Performing Arts</option>
<option value="Pharmacist" <?php echo ($selected == "Pharmacist")? 'selected=selected' : '' ?>>Pharmacist</option>
<option value="Physician" <?php echo ($selected == "Physician")? 'selected=selected' : '' ?>>Physician</option>
<option value="Print Producer" <?php echo ($selected == "Print Producer")? 'selected=selected' : '' ?>>Print Producer</option>
<option value="Procurement Manager" <?php echo ($selected == "Procurement Manager")? 'selected=selected' : '' ?>>Procurement Manager</option>
<option value="Product Manager" <?php echo ($selected == "Product Manager")? 'selected=selected' : '' ?>>Product Manager</option>
<option value="Production Manager" <?php echo ($selected == "Production Manager")? 'selected=selected' : '' ?>>Production Manager</option>
<option value="Project Engineering" <?php echo ($selected == "Project Engineering")? 'selected=selected' : '' ?>>Project Engineering</option>
<option value="Project Management - Retail" <?php echo ($selected == "Project Management - Retail")? 'selected=selected' : '' ?>>Project Management - Retail</option>
<option value="Project Management - Construction" <?php echo ($selected == "Project Management - Construction")? 'selected=selected' : '' ?>>Project Management - Construction</option>
<option value="Purchasing Manager" <?php echo ($selected == "Purchasing Manager")? 'selected=selected' : '' ?>>Purchasing Manager</option>
<option value="Psychologist" <?php echo ($selected == "Psychologist")? 'selected=selected' : '' ?>>Psychologist</option>
<option value="Quality &amp; Assurance" <?php echo ($selected == "Quality & Assurance")? 'selected=selected' : '' ?>>Quality &amp; Assurance</option>
<option value="Real Estate Agent" <?php echo ($selected == "Real Estate Agent")? 'selected=selected' : '' ?>>Real Estate Agent</option>
<option value="Receptionist" <?php echo ($selected == "Receptionist")? 'selected=selected' : '' ?>>Receptionist</option>
<option value="Records Management" <?php echo ($selected == "Records Management")? 'selected=selected' : '' ?>>Records Management</option>
<option value="Recruitment Manager" <?php echo ($selected == "Recruitment Manager")? 'selected=selected' : '' ?>>Recruitment Manager</option>
<option value="Regional Manager" <?php echo ($selected == "Regional Manager")? 'selected=selected' : '' ?>>Regional Manager</option>
<option value="Registered Nurse" <?php echo ($selected == "Registered Nurse")? 'selected=selected' : '' ?>>Registered Nurse</option>
<option value="Remuneration Manager" <?php echo ($selected == "Remuneration Manager")? 'selected=selected' : '' ?>>Remuneration Manager</option>
<option value="Retail Manager" <?php echo ($selected == "Retail Manager")? 'selected=selected' : '' ?>>Retail Manager</option>
<option value="Retoucher" <?php echo ($selected == "Retoucher")? 'selected=selected' : '' ?>>Retoucher</option>
<option value="Risk Management" <?php echo ($selected == "Risk Management")? 'selected=selected' : '' ?>>Risk Management</option>
<option value="Sales Director" <?php echo ($selected == "Sales Director")? 'selected=selected' : '' ?>>Sales Director</option>
<option value="Sales Event Coordinator" <?php echo ($selected == "Sales Event Coordinator")? 'selected=selected' : '' ?>>Sales Event Coordinator</option>
<option value="Sales ManagerSales Manager" <?php echo ($selected == "Sales ManagerSales Manager")? 'selected=selected' : '' ?>>Sales ManagerSales Manager</option>
<option value="Sales Representative" <?php echo ($selected == "Sales Representative")? 'selected=selected' : '' ?>>Sales Representative</option>
<option value="Secretary" <?php echo ($selected == "Secretary")? 'selected=selected' : '' ?>>Secretary</option>
<option value="Senior Account Director" <?php echo ($selected == "Senior Account Director")? 'selected=selected' : '' ?>>Senior Account Director</option>
<option value="Senior Account Manager" <?php echo ($selected == "Senior Account Manager")? 'selected=selected' : '' ?>>Senior Account Manager</option>
<option value="Social Media roles" <?php echo ($selected == "Social Media roles")? 'selected=selected' : '' ?>>Social Media roles</option>
<option value="Software Developer" <?php echo ($selected == "Software Developer")? 'selected=selected' : '' ?>>Software Developer</option>
<option value="Studio Manager" <?php echo ($selected == "Studio Manager")? 'selected=selected' : '' ?>>Studio Manager</option>
<option value="Systems Architect - IT" <?php echo ($selected == "Systems Architect - IT")? 'selected=selected' : '' ?>>Systems Architect - IT</option>
<option value="Teacher" <?php echo ($selected == "Teacher")? 'selected=selected' : '' ?>>Teacher</option>
<option value="Teachers Aide" <?php echo ($selected == "Teachers Aide")? 'selected=selected' : '' ?>>Teachers Aide</option>
<option value="Team Leader roles" <?php echo ($selected == "Team Leader roles")? 'selected=selected' : '' ?>>Team Leader roles</option>
<option value="Training Manager" <?php echo ($selected == "Training Manager")? 'selected=selected' : '' ?>>Training Manager</option>
<option value="Travel Agent" <?php echo ($selected == "Travel Agent")? 'selected=selected' : '' ?>>Travel Agent</option>
<option value="Urban Planner" <?php echo ($selected == "Urban Planner")? 'selected=selected' : '' ?>>Urban Planner</option>
<option value="Veterinarian" <?php echo ($selected == "Veterinarian")? 'selected=selected' : '' ?>>Veterinarian</option>
<option value="Volunteer roles" <?php echo ($selected == "Volunteer roles")? 'selected=selected' : '' ?>>Volunteer roles</option>
<option value="Warehouse Manager" <?php echo ($selected == "Warehouse Manager")? 'selected=selected' : '' ?>>Warehouse Manager</option>
<option value="Web Developer" <?php echo ($selected == "Web Developer")? 'selected=selected' : '' ?>>Web Developer</option>
<option value="WorkCover Coordinator" <?php echo ($selected == "WorkCover Coordinator")? 'selected=selected' : '' ?>>WorkCover Coordinator</option>
<option value="ZoologistZoologist" <?php echo ($selected == "ZoologistZoologist")? 'selected=selected' : '' ?>>ZoologistZoologist</option>
</select>


<span class="description">Second position. <strong>(Required)</strong></span>
</td>
</tr>


<tr>


<th><label for="work_type">Work Type Seeking</label></th>
<td>
<?php
//get dropdown saved value
$selected = get_the_author_meta( 'work_type', $user->ID );
?>
<select name="work_type" id="work_type" style="width:100%;" required >


Answers (1)

2014-01-03

Hariprasad Vijayan answers:

Hello Sean,

I had mentioned about this as a discourse for one of your previous question (http://www.wpquestions.com/user/discourseShow/id/5721/discourse_id/1011). Change validate_field() function like following

function validate_field(&$errors, $update = null, &$user = null)
{
global $current_user;
get_currentuserinfo();
if ( user_can( $current_user, "s2member_level2" ) )
{
if ($_POST['business_name']=='' or $_POST['business_name']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_business_name', "ERROR: Please enter your BUSINESS name.");
}
}
if ( user_can( $current_user, "s2member_level1" ) )
{
if ($_POST['brand_desc']=='' or $_POST['brand_desc']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_brand_desc', "ERROR: Please enter your BRAND description.");
}
if ($_POST['industry']=='' or $_POST['industry']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_industry', "ERROR: Please select a valid INDUSTRY value.");
}
if ($_POST['exp_years']=='' or $_POST['exp_years']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_exp_years', "ERROR: Please select a valid YEARS OF EXPERIENCE value.");
}
if ($_POST['education']=='' or $_POST['education']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_education', "ERROR: Please select a valid EDUCATION value.");
}
if ($_POST['state']=='' or $_POST['state']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_state', "ERROR: Please select a valid STATE value.");
}
if ($_POST['emp_status']=='' or $_POST['emp_status']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_emp_status', "ERROR: Please select a valid EMPLOYMENT STATUS value.");
}
if ($_POST['seeking_one']=='' or $_POST['seeking_one']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_seeking_one', "ERROR: Please select a valid SEEKING POSITION 1 value.");
}
if ($_POST['seeking_two']=='' or $_POST['seeking_two']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_seeking_two', "ERROR: Please select a valid SEEKING POSITION 2 value.");
}
if ($_POST['work_type']=='' or $_POST['work_type']==NULL) // Change to check for empty or any regular expression.
{
$errors->add('empty_work_type', "ERROR: Please select a valid WORK TYPE value.");
}
}
}

Hope it solves the issue. Let me know if you have any trouble.


Sean Gartlan comments:

Hari,

I didn't see your previous suggestion on the other thread so thanks again for responding...

I tried your suggestion and it seems to be working fine...

Thanks again for the great support...

Cheers,
Sean.