Jump to content
Larry Ullman's Book Forums

Recommended Posts

I have a registration form on my job-site that I would like to change slightly. Part of the form consists of "Job Category" and "Skills" the skills area is dynamically populated from an item that a user selects from the "Job Category". When they register on the site they are sent a registration email. Contained within the email is a verification link. The user verifies their account and are then able to login. When they login they are then taken to the login screen with the welcome message Dear John welcome back to the site. All pretty normal stuff really, however I have discovered that some job seekers have skills in more than one "Job Category" so what i was wanting to do was the following:

 

Take off the "Job Category and Skills" from the registration form and create new forms with just these two elements and also give the user the option to add a further Job Category or not.

 

In order to do this when a user first logs in after verifying their account is it possible to direct them to the Job Category and Skills page so they can make their selection and is there a way of checking that if they don't but log in again the site knows that this function has not been completed and keep sending them to the Job Category and Skills page every time they log in until they have completed this task. once this has been completed and the user logs in again it will just take them to the welcome page as normal.

 

Sorry if this is a bit long winded but It was the best way I could explain it.

 

A simple Yes this can be done or No it cant would suffice.

 

If this can't be done I have another idea by simply leaving the form as is and adding a link to the menu when the user is logged in that takes them to the new form and allows then to add Job categories and Skills.

 

Any help appreciated

 

 

Thanks

Link to comment
Share on other sites

Thanks Jon.

 

I may need a bit of guidance with this.

 

To start I was thinking of creating a duplicate of the registration form and putting it in a test folder together with the form processor which in this case is jobseeker_registration2.php. I can then remove the relevant industry section from the form and rename the welcome message to read something along the lines of

 

"Thank you for registering on the site. You will shortly receive a welcome email, contained within this email will be a verification link. You must verify your account by clicking on the link to fully register. Once your account is registered please login, you will then be able to select your industry and skills. and also upload your C.V."

 

That's my thinking so far. I don't want to alter the original signup form or the form processor until I have the new ones right just in case I screw something up.

 

Am I thinking along the right lines by creating all the new form in a test folder and making sure they work first.

Link to comment
Share on other sites

Unless you want to force a page reload every time the user selects something, I would do this completely in JS.

To do that, you'll want a JS array with all the industries, and then another (multi-dimensional) array/object that has all the skills for each of the industries.

With that data, you can easily populate as many select elements as the user needs.

I wouldn't do anything fancy beyond that.

 

As for the other thing you asked about, when the user submits the form, I would check that everything is valid, and if it is, I would change a flag in the DB, which doesn't allow the user to move on to the site unless they have selected some job skills.

 

I know my answer is a bit vague, but does that make sense?

Link to comment
Share on other sites

I've sort of got the hang of it. Iv'e figured out the JavaScript and also the form knows the user is not logged in (I think) it takes me to the login page when I try and access the page. I just can't seem to put the data in the database. Every time I try everything just disapears off the page including the form. The table name is job_seekers_info and the two columns are job_category and skills.

 

I have added the page and would be grateful of any help.

<?php
require_once "../conn.php";
include_once "accesscontrol.php";

$uname = $_SESSION[uname];

?>

<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
function Validateskillsfrm(theForm)
{
   var regexp;
   if (theForm.JobCategory.selectedIndex < 0)
   {
      alert("You must select a \"Job Category\"");
      theForm.JobCategory.focus();
      return false;
   }
   if (theForm.JobSkills.selectedIndex < 0)
   {
      alert("You must select at least 1 \"Skill\"");
      theForm.JobSkills.focus();
      return false;
   }
   return true;
}
</script>
<script type="text/javascript" src="wwb9.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
   LoadValue('JobCategory', 'session', 2);
   LoadValue('JobSkills', 'session', 2);
   $("#skillsfrm").submit(function(event)
   {
      StoreValue('JobCategory', 'session', 2);
      StoreValue('JobSkills', 'session', 2);
      return true;
   });
});
</script>
<script type="text/javascript">
function fillSecondCombo()
{
   var combo1 = document.getElementById('JobCategory');
   var combo2 = document.getElementById('JobSkills');
   var selected = combo1.options[combo1.options.selectedIndex].value;
   if (selected == "Agriculture")
   {
      combo2.options.length = 3;
      combo2.options[0] = new Option("Agricultural Engineer", "Agricultural Engineer");
      combo2.options[1] = new Option("Animal Care", "Animal Care");
      combo2.options[2] = new Option("Dairy Worker", "Dairy Worker");
      combo2.options[3] = new Option("Farm Worker", "Farm Worker");
      combo2.options[4] = new Option("Harvesting Equipment Driver", "Harvesting Equipment Driver");
      combo2.options[5] = new Option("Tractor Driver", "Tractor Driver");
      combo2.options[6] = new Option("Zoo and Safari Park Worker", "Zoo and Safari Park Worker");
      combo2.options[7] = new Option("Other (As Per CV)", "Other (As Per CV)");
   }
   else
   if (selected == "Catering and Hotel Work")
   {
      combo2.options.length = 3;
      combo2.options[0] = new Option("Baker", "Baker");
      combo2.options[1] = new Option("Bar Worker", "Bar Worker");
      combo2.options[2] = new Option("Barista", "Barista");
      combo2.options[3] = new Option("Butcher", "Butcher");
      combo2.options[4] = new Option("Chef / Cook", "Chef / Cook");
      combo2.options[5] = new Option("Catering Manager", "Catering Manager");
      combo2.options[6] = new Option("Housekeeping", "Housekeeping");
      combo2.options[7] = new Option("Hotel Management", "Hotel Management");
      combo2.options[8] = new Option("Hotel Front of House", "Hotel Front of House");
      combo2.options[9] = new Option("Hotel Portering", "Hotel Portering");
      combo2.options[10] = new Option("Licensed Premises Manager", "Licensed Premises Manager");
      combo2.options[11] = new Option("Restaurant Manager", "Restaurant Manager");
      combo2.options[12] = new Option("Waiting at Tables", "Waiting at Tables");
      combo2.options[13] = new Option("Other (As Per CV)", "Other (As Per CV)");
       
  }
}
</script>
</head>
<body>
<div id="container">
<div id="wb_Home_Page_Text" style="position:absolute;left:390px;top:1173px;width:108px;height:16px;z-index:9;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;"><a href="./../index.php" class="style1">Home Page</a></span></div>
<div id="wb_home" style="position:absolute;left:393px;top:1114px;width:57px;height:57px;z-index:10;">
<a href="./skills.php"><img src="images/home.png" id="home" alt="return to home page button" style="width:57px;height:57px;"></a></div>
<div id="wb_skillsfrm" style="position:absolute;left:67px;top:10px;width:386px;height:402px;z-index:11;">
<form name="skillsfrm" method="post" action="<?php echo basename(__FILE__);?>" enctype="multipart/form-data" accept-charset="UTF-8" id="skillsfrm" onsubmit="return Validateskillsfrm(this)">
<select name="Job_Category" size="1" id="JobCategory" onchange="fillSecondCombo();return false;" style="position:absolute;left:141px;top:89px;width:111px;height:25px;z-index:0;" tabindex="5" title="Job Category:">
<option selected value="0">Please select an option</option>
<option value="Agriculture">Agriculture</option>
<option value="Catering and Hotel Work">Catering and Hotel Work</option>
<option value="Cleaning and Environmental">Cleaning and Environmental</option>
<option value="Education and Training">Education and Training</option>
<option value="Engineering">Engineering</option>
<option value="Finance and Legal">Finance and Legal</option>
<option value="Horticulture">Horticulture</option>
<option value="Information Technology">Information Technology</option>
<option value="Leisure Industry">Leisure Industry</option>
<option value="Manufacturing">Manufacturing</option>
<option value="Medical">Medical</option>
<option value="Office and Commercial">Office and Commercial</option>
<option value="Plant and Construction">Plant and Construction</option>
<option value="Sales and Retail">Sales and Retail</option>
<option value="Security">Security</option>
<option value="Transport and Motor Trade">Transport and Motor Trade</option>
<option value="Warehouse and Logistics">Warehouse and Logistics</option>
<option value="Veterinary Services">Veterinary Services</option>
</select>
<div id="wb_Text7" style="position:absolute;left:10px;top:91px;width:128px;height:16px;z-index:1;text-align:left;">
<span style="color:#0000CD;font-family:Arial;font-size:13px;"><strong>Main Job Category:</strong></span></div>
<div id="wb_Text8" style="position:absolute;left:1px;top:120px;width:146px;height:64px;z-index:2;text-align:left;">
<span style="color:#0000CD;font-family:Arial;font-size:13px;"><strong>  Main Job Skills:</strong></span><span style="color:#000000;font-family:Arial;font-size:13px;"><br><br></span><span style="color:#FF0000;font-family:Arial;font-size:13px;"><strong>Auto Populates from "Main Job Category"</strong></span></div>
<input type="submit" id="Button1" name="submit" value="Update" style="position:absolute;left:142px;top:299px;width:96px;height:25px;z-index:3;">
<input type="reset" id="Button2" name="reset" value="Reset" style="position:absolute;left:143px;top:337px;width:96px;height:25px;z-index:4;">
<div id="wb_Text11" style="position:absolute;left:0px;top:195px;width:134px;height:60px;text-align:center;z-index:5;">
<span style="color:#000000;font-family:Arial;font-size:12px;">You can select more than one job skill by holding down the CTRL key on your keyboard</span></div>
<select name="Job_Skills[]" multiple size="1" id="JobSkills" style="position:absolute;left:142px;top:121px;width:226px;height:163px;z-index:6;" tabindex="6" title="Job Skills:">
</select>

<div id="wb_Text1" style="position:absolute;left:64px;top:25px;width:279px;height:32px;text-align:center;z-index:8;">
<span style="color:#000000;font-family:Arial;font-size:13px;"><strong>Please use this form to add or update your "Job Category" and "Skills"</strong></span></div>
</form>
</div>
</div>
</body>
</html>
Link to comment
Share on other sites

 Share

×
×
  • Create New...