SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Form with Drop Down Menu - Using GET Statement.

    Hello,

    I have a form where I have a security question at the end. If the user submits a wrong answer, it bounces back to the form page and says "Invalid Security Code. Please Try Again."

    Also, when they are bounced back after the invalid security code, all the information that the user typed in is saved, just by using the GET statement.

    One problem, and my only problem, is when I have a drop down menu such as "Select Your State".

    Here is my code:

    PHP Code:
    <select name="State" id="State" value="<?php echo  $_GET['State']; ?>">
              <option value="AL">AL</option>
              <option value="AK">AK</option>
              <option value="AS">AS</option>
              <option value="AZ">AZ</option>
              <option value="AR">AR</option>
              <option value="CA">CA</option>
              <option value="CO">CO</option>
              <option value="CT">CT</option>
              <option value="DE">DE</option>
              <option value="FL">FL</option>
              <option value="GA">GA</option>
              <option value="HI">HI</option>
              <option value="ID">ID</option>
              <option value="IL">IL</option>
              <option value="IN">IN</option>
              <option value="IA">IA</option>
              <option value="KS">KS</option>
              <option value="KY">KY</option>
              <option value="LA">LA</option>
              <option value="ME">ME</option>
              <option value="MD">MD</option>
              <option value="MA">MA</option>
              <option value="MI">MI</option>
              <option value="MN">MN</option>
              <option value="MS">MS</option>
              <option value="MO">MO</option>
              <option value="MT">MT</option>
              <option value="NE">NE</option>
              <option value="NV">NV</option>
              <option value="NH">NH</option>
              <option value="NJ">NJ</option>
              <option value="NM">NM</option>
              <option value="NY">NY</option>
              <option value="NC">NC</option>
              <option value="ND">ND</option>
              <option value="OH">OH</option>
              <option value="OK">OK</option>
              <option value="OR">OR</option>
              <option value="PA">PA</option>
              <option value="RI">RI</option>
              <option value="SC">SC</option>
              <option value="SD">SD</option>
              <option value="TN">TN</option>
              <option value="TX">TX</option>
              <option value="UT">UT</option>
              <option value="VT">VT</option>
              <option value="VA">VA</option>
              <option value="WA">WA</option>
              <option value="WV">WV</option>
              <option value="WI">WI</option>
              <option value="WY">WY</option>
              <option value=" " selected="selected"> </option>
            </select>
    I have this setup exactly how I have the text fields set up with the value being set.

    The drop down menus come back to normal when the user enters an invalid security code.

    How can I have it so whatever they select in a drop down menu stays there if they enter an invalid code?

    The code works for text fields, just not drop down menus.

    Thanks!

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    With select options, to choose a default value you use the 'selected' property.

    So here's a solution for you. Instead of outputting the HTML manually, have an array of the states, and loop through. If it's the wanted value, then it will be selected:
    PHP Code:
    <?php
    $states 
    = array('AL''AK''AS''AZ''AR''CA''CO''CT''DE''FL''GA''HI''ID''IL''IN''IA''KS''KY''LA''ME''MD''MA''MI''MN''MS''MO''MT''NE''NV''NH''NJ''NM''NY''NC''ND''OH''OK''OR''PA''RI''SC''SD''TN''TX''UT''VT''VA''WA''WV''WI''WY');
    echo 
    '<select name="State" id="State"><option value=""></option>';
    $format '<option value="%1$s"%2$s>%1$s</option>';
    foreach(
    $states as $state){
        
    printf($format$state, ((isset($_GET['state']) && $_GET['state'] == $state) ? ' selected="selected"' ''));
    }
    echo 
    '</select>';
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great. Thanks for that!

    How would I code that in the form? Would I still need <select> etc...

    Thanks again.

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, I appreciate your help, but that killed my entire form. Something is wrong with that.

    Can you go into a little more detail or give me an alternate way?

    Thanks.

  5. #5
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Can I see the rest of the code then?

    On my localhost, this code works:
    PHP Code:
    <?php 
    error_reporting
    (E_ALL);
    ini_set('display_errors'2);
    echo 
    '<form method="get" action="">';
    $states = array('AL''AK''AS''AZ''AR''CA''CO''CT''DE''FL''GA''HI''ID''IL''IN''IA''KS''KY''LA''ME''MD''MA''MI''MN''MS''MO''MT''NE''NV''NH''NJ''NM''NY''NC''ND''OH''OK''OR''PA''RI''SC''SD''TN''TX''UT''VT''VA''WA''WV''WI''WY'); 
    echo 
    '<select name="State" id="State"><option value=""></option>'
    $format '<option value="%1$s"%2$s>%1$s</option>'
    foreach(
    $states as $state){ 
        
    printf($format$state, ((isset($_GET['State']) && $_GET['State'] == $state) ? ' selected="selected"' '')); 

    echo 
    '</select>';
    echo 
    '<input type="submit" />';
    echo 
    '</form>';
    ?>
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  6. #6
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php session_start(); ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Website Employment Application</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <link href="print.css" rel="stylesheet" type="text/css" media="print" />
    <style type="text/css">
    <!--
    .style1 {
        font-size: 16px;
        font-weight: bold;
        color: white;
    }
    .style2 {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 14px;
        color: white;
    }
    .style3 {
        font-size: 14px;
        font-weight: bold;
        font-family: Verdana, Arial, Helvetica, sans-serif;
        color: white;
    }
    .style8 {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 12px;
    }
    .style11 {color: #CCCCCC}
    .style13 {font-size: 10px}
    .style14 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
    .style15 {color: #FFFFFF}
    .style16 {font-family: Verdana, Arial, Helvetica, sans-serif}
    .style17 {
        font-size: 12px;
        color: #FFFFFF;
    }
    a:link {
        color: #FFFFFF;
        text-decoration: none;
    }
    a:visited {
        text-decoration: none;
        color: #FFFFFF;
    }
    a:hover {
        text-decoration: underline;
        color: #FFFFFF;
    }
    a:active {
        text-decoration: none;
        color: #FFFFFF;
    }
    body,td,th {
        color: #FFFFFF;
    }




    @page figures {

    size: portrait;

    }



    -->
    </style>
    </head>

    <body>












    <div class="photomainshell2">
        
    <div style="border-bottom: 1px solid white"; align:"center"><img src="images/Employment_Application.gif" width="850" height="78" border="0" alt="" /></div>
            
    <div class="formcontents">
      <div align="center"><span class="style17"><br />  
          <span class="style16"><a href="http://www.website.com/website/Application.doc"><img src="images/word_doc_icon_new.gif" width="50" height="56" border="0" /></a><br />
          <a href="http://www.website.com/website Application.doc">Click here if you would prefer to fill out an application in MS Word format.</a></span><br />
          <br />
        
        
        </span>
          <!-- FORM BEGIN -->
          
          <?php
        $error 
    strstr($_GET['error'], 'err');
    if (
    strlen($error)) {
    echo 
    "<span style=\"font-weight:bold; color:#CC0000; background-color:#bfd1e0; border: 2px solid #80a4c0; padding: 5px; width: 500px;\">Invalid security answer. Please try again.</span>";} else {
    echo 
    " ";
    }
    ?>


      </div>
      <form name="formcheck" method="post" action="formhandler.php" onSubmit="return formCheck(this);">
    <div class="application">
      
    <!-- DATE -->  
    <fieldset>
        <legend class="style1 style2">TODAY'S DATE</legend> 
        <br />
        
        <div class="style8" style="color: white;">
          <input name="date" type="text" id="date" value="<?php print date('m/d/y'); ?>" />
        </div>
        <br />
    </fieldset>

    <!-- PERSONAL INFORMATION PART I -->  
    <fieldset>
        <legend class="style1 style2">PERSONAL INFORMATION</legend> 
        <br />
        
        <div class="style8">NAME</div>
        <div class="applicationdivider"></div> 
        
        <br />
        
          <div class="style11">
            <p class="style15">First:
              <input name="FirstName" type="text" id="FirstName" size="20" value="<?php echo  $_GET['FirstName']; ?>"/> 
              Last:
              <input name="LastName" type="text" id="LastName" size="20" value="<?php echo  $_GET['LastName']; ?>"/>
              Middle:
              <input name="MiddleName" type="text" id="MiddleName" size="1" value="<?php echo  $_GET['MiddleName']; ?>"/>
              <br />
              <br />
              <span class="style15"><br />
              Social Security Number:</span> 
              <input name="SSN" type="text" id="SSN" size="9" maxlength="9" value="<?php echo  $_GET['SSN']; ?>"/> 
              E-Mail Address: 
              <input type="text" name="email" id="email" value="<?php echo  $_GET['email']; ?>"/>
              <br />
              <br />
              <strong></strong></p>
            </div>
          <strong><div class="style8">Present Address</div></strong>
          <div class="applicationdivider"></div>
          <br />
          Street: 
          <input type="text" name="Street" id="Street" value="<?php echo  $_GET['Street']; ?>"/>
           City: 
           <input name="City" type="text" id="City" size="20" />
            State: 
            <select name="State" id="State" value="<?php echo  $_GET['State']; ?>">
              <option value="AL">AL</option>
              <option value="AK">AK</option>
              <option value="AS">AS</option>
              <option value="AZ">AZ</option>
              <option value="AR">AR</option>
              <option value="CA">CA</option>
              <option value="CO">CO</option>
              <option value="CT">CT</option>
              <option value="DE">DE</option>
              <option value="FL">FL</option>
              <option value="GA">GA</option>
              <option value="HI">HI</option>
              <option value="ID">ID</option>
              <option value="IL">IL</option>
              <option value="IN">IN</option>
              <option value="IA">IA</option>
              <option value="KS">KS</option>
              <option value="KY">KY</option>
              <option value="LA">LA</option>
              <option value="ME">ME</option>
              <option value="MD">MD</option>
              <option value="MA">MA</option>
              <option value="MI">MI</option>
              <option value="MN">MN</option>
              <option value="MS">MS</option>
              <option value="MO">MO</option>
              <option value="MT">MT</option>
              <option value="NE">NE</option>
              <option value="NV">NV</option>
              <option value="NH">NH</option>
              <option value="NJ">NJ</option>
              <option value="NM">NM</option>
              <option value="NY">NY</option>
              <option value="NC">NC</option>
              <option value="ND">ND</option>
              <option value="OH">OH</option>
              <option value="OK">OK</option>
              <option value="OR">OR</option>
              <option value="PA">PA</option>
              <option value="RI">RI</option>
              <option value="SC">SC</option>
              <option value="SD">SD</option>
              <option value="TN">TN</option>
              <option value="TX">TX</option>
              <option value="UT">UT</option>
              <option value="VT">VT</option>
              <option value="VA">VA</option>
              <option value="WA">WA</option>
              <option value="WV">WV</option>
              <option value="WI">WI</option>
              <option value="WY">WY</option>
              <option value=" " selected="selected"> </option>
            </select>
             Zip: 
             <input name="Zip" type="text" id="Zip" size="5" maxlength="5" value="<?php echo  $_GET['Zip']; ?>"/>
            <br />
            <br />
            <br />
            Telephone: 
      <input name="Telephone" type="text" id="Telephone" size="14" maxlength="10" value="<?php echo  $_GET['Telephone']; ?>"/>
              Referred By: 
              <input name="ReferredBy" type="text" id="ReferredBy" size="30" value="<?php echo  $_GET['ReferredBy']; ?>"/>
             <br />
             </p>
             <br />
    </fieldset>
      
      
      <br />
      <br />


    <!-- PERSONAL INFORMATION PART II -->  

    <fieldset>

    <legend class="style3">EMPLOYMENT</legend> 
        <p>Position:
          <input name="Position" type="text" id="Position" size="20" value="<?php echo  $_GET['Position']; ?>"/>
          Date you can start
          :
          <input name="StartDate" type="text" id="StartDate" size="20" value="<?php echo  $_GET['StartDate']; ?>"/>
          Salary Desired:
          <input name="Salary" type="text" id="Salary" value="$" size="10" value="<?php echo  $_GET['Salary']; ?>"/>
          </p>
          Are you employed now? 
          <select name="Employed" id="Employed" value="<?php echo  $_GET['Employed']; ?>">
            <option value=" " selected="selected"> </option>
            <option value="Yes">Yes</option>
            <option value="No">No</option>
          </select>
          If so, may we inquire, of your present employer? 
          <select name="Inquire" id="Inquire" value="<?php echo  $_GET['Inquire']; ?>">
            <option value=" " selected="selected"> </option>
            <option value="Yes">Yes</option>
            <option value="No">No</option>
          </select>
          <br />
          <br />
          Have you ever applied to this company before? 
          <select name="Applied" id="Applied" value="<?php echo  $_GET['Applied']; ?>">
            <option value=" " selected="selected"> </option>
            <option value="Yes">Yes</option>
            <option value="No">No</option>
          </select>
          If so, when? 
          <input type="text" name="WhenDidYouApply" id="WhenDidYouApply" value="<?php echo  $_GET['WhenDidYouApply']; ?>"/>
          <br />
          </p>
          <br />
    </fieldset>
      
      
      <br />
      <br />
      


    <!-- EDUCATION -->  

    <fieldset>
      
    <legend class="style3">EDUCATION</legend> 
        <br />
        <strong><div class="style8">Grammar School</div></strong>
        <div class="applicationdivider"></div>
        
        <br />
          
          Name:
          <input name="NameGrammar" type="text" id="NameGrammar" size="20" value="<?php echo  $_GET['NameGrammar']; ?>"/>
          Location:
          <input name="LocationGrammar" type="text" id="LocationGrammar" size="20" value="<?php echo  $_GET['LocationGrammar']; ?>"/>
           Indicate Last Year Completed: 
           <input name="LastYearGrammar" type="text" id="LastYearGrammar" size="4" maxlength="4" value="<?php echo  $_GET['LastYearGrammar']; ?>"/>
           <br />
           <br />
          
        Did you graduate? 
        <select name="GraduateGrammar" id="GraduateGrammar" value="<?php echo  $_GET['GraduateGrammar']; ?>">
          <option value=" " selected="selected"> </option>
          <option value="Yes">Yes</option>
          <option value="No">No</option>
        </select>
        Subjects Studied and Degree(s) Received:
        <input name="SubjectsGrammar" type="text" id="SubjectsGrammar" size="30" value="<?php echo  $_GET['SubjectsGrammar']; ?>"/>
        <br />
        </p>
        <br />
        <br />
          <div class="application style8">High School</div>
          <div class="applicationdivider"></div>
        <br />
          
          Name:
          <input name="NameHS" type="text" id="NameHS" size="20" value="<?php echo  $_GET['NameHS']; ?>"/>
          Location:
          <input name="LocationHS" type="text" id="LocationHS" size="20" value="<?php echo  $_GET['LocationHS']; ?>"/>
           Indicate Last Year Completed: 
           <input name="LastYearHS" type="text" id="LastYearHS" size="4" maxlength="4" value="<?php echo  $_GET['LastYearHS']; ?>"/>
           
           <br />
           <br />
          
        Did you graduate? 
        <select name="GraduateHS" id="GraduateHS" value="<?php echo  $_GET['GraduateHS']; ?>">
          <option value=" " selected="selected"> </option>
          <option value="Yes">Yes</option>
          <option value="No">No</option>
        </select>
        Subjects Studied and Degree(s) Received:
        <input name="SubjectsHS" type="text" id="SubjectsHS" size="30" value="<?php echo  $_GET['SubjectsHS']; ?>"/>
        <br />
        <br />
        <br />
        <strong>College</strong>
          <div class="applicationdivider"></div>
        <br />
    Name:
    <input name="NameCollege" type="text" id="NameCollege" size="20" value="<?php echo  $_GET['NameCollege']; ?>"/>
    Location:
    <input name="LocationCollege" type="text" id="LocationCollege" size="20" value="<?php echo  $_GET['LocationCollege']; ?>"/>
    Indicate Last Year Completed:
    <input name="LastYearCollege" type="text" id="LastYearCollege" size="4" maxlength="4" value="<?php echo  $_GET['LastYearCollege']; ?>"/>
    <br />
    <br />
    Did you graduate?
    <select name="GraduateCollege" id="GraduateCollege" value="<?php echo  $_GET['GraduateCollege']; ?>">
      <option value=" " selected="selected"> </option>
      <option value="Yes">Yes</option>
      <option value="No">No</option>
    </select>
    Subjects Studied and Degree(s) Received:
    <input name="SubjectsCollege" type="text" id="SubjectsCollege" size="30" value="<?php echo  $_GET['SubjectsCollege']; ?>"/>
    <br />
    <br />
    <br />
    <strong>Trade, Business, or Correspondence School</strong>
          <div class="applicationdivider"></div>
       <br />
          Name:
          <input name="NameTrade" type="text" id="NameTrade" size="20" value="<?php echo  $_GET['NameTrade']; ?>"/>
    Location:
    <input name="LocationTrade" type="text" id="LocationTrade" size="20" value="<?php echo  $_GET['LocationTrade']; ?>"/>
    Indicate Last Year Completed:
    <input name="LastYearTrade" type="text" id="LastYearTrade" size="4" value="<?php echo  $_GET['LastYearTrade']; ?>"/>

    <br />
    <br />

    Did you graduate?
    <select name="GraduateTrade" id="GraduateTrade" value="<?php echo  $_GET['GraduateTrade']; ?>">
      <option value=" " selected="selected"> </option>
      <option value="Yes">Yes</option>
      <option value="No">No</option>
    </select>
    Subjects Studied and Degree(s) Received:
    <input name="SubjectsTrade" type="text" id="SubjectsTrade" size="30" value="<?php echo  $_GET['SubjectsTrade']; ?>"/>
          <br />
          <br />

        <div class="applicationdivider"></div>
          <p><br />
         Subjects of special study or research work:<br />
              <textarea name="SpecialStudy" cols="90" rows="5" id="SpecialStudy" value="<?php echo  $_GET['SpecialStudy']; ?>"></textarea>
              <br />
              <br />
             What foreign languages (if any) do you speak fluently? 
            <input type="text" name="ForeignLanguage" id="ForeignLanguage" value="<?php echo  $_GET['ForeignLanguage']; ?>"/>
         <br />
         <br />
            Read: 
            <input type="text" name="ForeignRead" id="ForeignRead" value="<?php echo  $_GET['ForeignRead']; ?>"/> 
            Write: 
            <input type="text" name="ForeignWrite" id="ForeignWrite" value="<?php echo  $_GET['ForeignWrite']; ?>"/>
            <br />
              <br />
            Activities other than religious (civic, athletic, etc.)
            
            <br />
                
                <textarea name="Activities" cols="90" rows="5" id="Activities" value="<?php echo  $_GET['Activities']; ?>">Exclude organizations the name or character of which indicates the race, color, or national origin of its members.</textarea>
                <br />
                <br />
          </p>
    </fieldset>

    <br />
    <br />

    <!-- PREVIOUS EMPLOYMENT -->  

    <fieldset>
      
    <legend class="style3">FORMER EMPLOYERS <span class="style13">(list below last four employers, starting with last one first)</span></legend> 
        <br />
        <strong>
        <div class="style8">Employer One</div>
        </strong>
        <div class="applicationdivider"></div>
        
        <br />
          
          Date (month/year):<br />
          
          From:
          <input name="DateFromEmployerOne" type="text" id="DateFromEmployerOne" size="7" maxlength="7" value="<?php echo  $_GET['DateFromEmployerOne']; ?>"/>
          To:
          <input name="DateToEmployerOne" type="text" id="DateToEmployerOne" size="7" maxlength="7" value="<?php echo  $_GET['DateToEmployerOne']; ?>"/>
           <br />
           <br />
           Name &amp; Address of Employer: 
           <input name="EmployerOneName" type="text" id="EmployerOneName" size="30" value="<?php echo  $_GET['EmployerOneName']; ?>"/>
           <br />
           <br />
           Supervisory Name: 
           <input type="text" name="supervisornameone" id="supervisornameone" value="<?php echo  $_GET['supervisornameone']; ?>"/>
            Supervisor Phone: 
            <input name="supervisorphoneone" type="text" id="supervisorphoneone" maxlength="10" value="<?php echo  $_GET['supervisorphoneone']; ?>"/>
            <br />
            <br />
            May We Contact This Employer? 
            <select name="contactone" id="contactone" value="<?php echo  $_GET['contactone']; ?>">
              <option value="Please Select" selected="selected">Please Select</option>
              <option value="Yes">Yes</option>
              <option value="No">No</option>
            </select>
            <br />
           <br />
          
        Salary: 
        <input name="SalaryEmployerOne" type="text" id="SalaryEmployerOne" value="$" size="10" value="<?php echo  $_GET['SalaryEmployerOne']; ?>"/>
        <br />
        <br />
        Position:
        <input name="PositionEmployerOne" type="text" id="PositionEmployerOne" size="30" value="<?php echo  $_GET['PositionEmployerOne']; ?>"/>
        <br />
        <br />
        Reason for Leaving:<br />
        <textarea name="ReasonEmployerOne" cols="90" rows="5" id="ReasonEmployerOne" value="<?php echo  $_GET['ReasonEmployerOne']; ?>"></textarea>
        <br />
        </p>
        <br />
        <br />
          <div class="style14">Employer Two</div>
          <div class="applicationdivider"></div>
        <br />
        Date (month/year):<br />
    From:
    <input name="DateFromEmployerTwo" type="text" id="DateFromEmployerTwo" size="7" maxlength="7" value="<?php echo  $_GET['DateFromEmployerTwo']; ?>"/>
    To:
    <input name="DateToEmployerTwo" type="text" id="DateToEmployerTwo" size="7" maxlength="7" value="<?php echo  $_GET['DateToEmployerTwo']; ?>"/>
    <br />
    <br />
    Name &amp; Address of Employer:
    <input name="EmployerTwoName" type="text" id="EmployerTwoName" size="30" value="<?php echo  $_GET['EmployerTwoName']; ?>"/>
    <br />
    <br />
    Supervisory Name:
    <input type="text" name="supervisornametwo" id="supervisornametwo" value="<?php echo  $_GET['supervisornametwo']; ?>"/>
    Supervisor Phone:
    <input name="supervisorphonetwo" type="text" id="supervisorphonetwo" maxlength="10" value="<?php echo  $_GET['supervisorphonetwo']; ?>"/>
    <br />
    <br />
    May We Contact This Employer?
    <select name="contacttwo" id="contacttwo" value="<?php echo  $_GET['contacttwo']; ?>">
      <option value="Please Select" selected="selected">Please Select</option>
      <option value="Yes">Yes</option>
      <option value="No">No</option>
    </select>
    <br />
    <br />
    Salary:
    <input name="SalaryEmployerTwo" type="text" id="SalaryEmployerTwo" value="$" size="10" value="<?php echo  $_GET['SalaryEmployerTwo']; ?>"/>
    <br />
    <br />
    Position:
    <input name="PositionEmployerTwo" type="text" id="PositionEmployerTwo" size="30" value="<?php echo  $_GET['PositionEmployerTwo']; ?>"/>
    <br />
    <br />
    Reason for Leaving:<br />
    <textarea name="ReasonEmployerTwo" cols="90" rows="5" id="ReasonEmployerTwo" value="<?php echo  $_GET['ReasonEmployerTwo']; ?>"></textarea>
    <br />
        <br />
        <br />
        <strong>Employer Three</strong>
          <div class="applicationdivider"></div>
        <br />
        Date (month/year):<br />
    From:
    <input name="DateFromEmployerThree" type="text" id="DateFromEmployerThree" size="7" maxlength="7" value="<?php echo  $_GET['DateFromEmployerThree']; ?>"/>
    To:
    <input name="DateToEmployerThree" type="text" id="DateToEmployerThree" size="7" maxlength="7" value="<?php echo  $_GET['DateToEmployerThree']; ?>"/>
    <br />
    <br />
    Name &amp; Address of Employer:
    <input name="EmployerThreeName" type="text" id="EmployerThreeName" size="30" value="<?php echo  $_GET['EmployerThreeName']; ?>"/>
    <br />
    <br />
    Supervisory Name:
    <input type="text" name="supervisornamethree" id="supervisornamethree" value="<?php echo  $_GET['supervisornamethree']; ?>"/>
    Supervisor Phone:
    <input name="supervisorphonethree" type="text" id="supervisorphonethree" maxlength="10" value="<?php echo  $_GET['supervisorphonethree']; ?>"/>
    <br />
    <br />
    May We Contact This Employer?
    <select name="contactthree" id="contactthree" value="<?php echo  $_GET['contactthree']; ?>">
      <option value="Please Select" selected="selected">Please Select</option>
      <option value="Yes">Yes</option>
      <option value="No">No</option>
    </select>
    <br />
    <br />
    Salary:
    <input name="SalaryEmployerThree" type="text" id="SalaryEmployerThree" value="$" size="10" value="<?php echo  $_GET['SalaryEmployerThree']; ?>"/>
    <br />
    <br />
    Position:
    <input name="PositionEmployerThree" type="text" id="PositionEmployerThree" size="30" value="<?php echo  $_GET['PositionEmployerThree']; ?>"/>
    <br />
    <br />
    Reason for Leaving:<br />
    <textarea name="ReasonEmployerThree" cols="90" rows="5" id="ReasonEmployerThree" value="<?php echo  $_GET['ReasonEmployerThree']; ?>"></textarea>
    <br />
    <br />
    <strong>Employer Four</strong>
    <div class="applicationdivider"></div>
    <br />
    Date (month/year):<br />
    From:
    <input name="DateFromEmployerFour" type="text" id="DateFromEmployerFour" size="7" maxlength="7" value="<?php echo  $_GET['DateFromEmployerFour']; ?>"/>
    To:
    <input name="DateToEmployerFour" type="text" id="DateToEmployerFour" size="7" maxlength="7" value="<?php echo  $_GET['DateToEmployerFour']; ?>"/>
    <br />
    <br />
    Name &amp; Address of Employer:
    <input name="EmployerFourName" type="text" id="EmployerFourName" size="30" value="<?php echo  $_GET['EmployerFourName']; ?>"/>
    <br />
    <br />
    Supervisory Name:
    <input type="text" name="supervisornamefour" id="supervisornamefour" value="<?php echo  $_GET['supervisornamefour']; ?>"/>
    Supervisor Phone:
    <input name="supervisorphonefour" type="text" id="supervisorphonefour" maxlength="10" value="<?php echo  $_GET['supervisorphonefour']; ?>"/>
    <br />
    <br />
    May We Contact This Employer?
    <select name="contactfour" id="contactfour" value="<?php echo  $_GET['contactfour']; ?>">
      <option value="Please Select" selected="selected">Please Select</option>
      <option value="Yes">Yes</option>
      <option value="No">No</option>
    </select>
    <br />
    <br />
    Salary:
    <input name="SalaryEmployerFour" type="text" id="SalaryEmployerFour" value="$" size="10" value="<?php echo  $_GET['SalaryEmployerFour']; ?>"/>
    <br />
    <br />
    Position:
    <input name="PositionEmployerFour" type="text" id="PositionEmployerFour" size="30" value="<?php echo  $_GET['PositionEmployerFour']; ?>"/>
    <br />
    <br />
    Reason for Leaving:<br />
    <textarea name="ReasonEmployerFour" cols="90" rows="5" id="ReasonEmployerFour" value="<?php echo  $_GET['ReasonEmployerFour']; ?>"></textarea>
    <br />
          </fieldset>
          
          
    <br />
    <br />


    <!-- REFERENCES -->  

    <fieldset>
      
    <legend class="style3">REFERENCES <span class="style13">(list below three references)</span></legend> 
        <br />
        <strong>
        <div class="style8">Reference One</div>
        </strong>
        <div class="applicationdivider"></div>
        
        <br />
          
          Name: 
          <input type="text" name="ReferenceOneName" id="ReferenceOneName" value="<?php echo  $_GET['ReferenceOneName']; ?>"/>
          <br />
          <br />
          Address: 
          <input name="ReferenceOneAddress" type="text" id="ReferenceOneAddress" size="40" value="<?php echo  $_GET['ReferenceOneAddress']; ?>"/>
          <br />
          <br />
          Phone Number: 
          <input name="referenceonephone" type="text" id="referenceonephone" maxlength="10" value="<?php echo  $_GET['referenceonephone']; ?>"/>
           E-Mail: 
           <input type="text" name="referenceoneemail" id="referenceoneemail" value="<?php echo  $_GET['referenceoneemail']; ?>"/>
           <br />
          <br />
          Business / Personal: 
          <select name="BusinessPersonalOneReference" id="BusinessPersonalOneReference" value="<?php echo  $_GET['BusinessPersonalOneReference']; ?>">
            <option value=" " selected="selected"> </option>
            <option value="Business">Business</option>
            <option value="Personal">Personal</option>
          </select>
          <br />
          <br />
          Years Aquainted: 
          <input name="ReferenceOneYearsAquainted" type="text" id="ReferenceOneYearsAquainted" size="2" maxlength="2" value="<?php echo  $_GET['ReferenceOneYearsAquainted']; ?>"/>
          <br />
        </p>
        <br />
        <br />
          <div class="style14">Reference Two</div>
          <div class="applicationdivider"></div>
        <br />
        Name:
        <input type="text" name="ReferenceTwoName" id="ReferenceTwoName" value="<?php echo  $_GET['ReferenceTwoName']; ?>"/>
        <br />
        <br />
    Address:
    <input name="ReferenceTwoAddress" type="text" id="ReferenceTwoAddress" size="40" value="<?php echo  $_GET['ReferenceTwoAddress']; ?>"/>
    <br />
    <br />
    Phone Number:
    <input name="referenceonephone2" type="text" id="referenceonephone2" maxlength="10" value="<?php echo  $_GET['referenceonephone2']; ?>"/>
    E-Mail:
    <input type="text" name="referencetwoemail" id="referencetwoemail" value="<?php echo  $_GET['referencetwoemail']; ?>"/>
    <br />
    <br />
    Business / Personal:
    <select name="BusinessPersonalTwoReference" id="BusinessPersonalTwoReference" value="<?php echo  $_GET['BusinessPersonalTwoReference']; ?>">
      <option value=" " selected="selected"> </option>
      <option value="Business">Business</option>
      <option value="Personal">Personal</option>
    </select>
    <br />
    <br />
    Years Aquainted:
    <input name="ReferenceTwoYearsAquainted" type="text" id="ReferenceTwoYearsAquainted" size="2" maxlength="2" value="<?php echo  $_GET['ReferenceTwoYearsAquainted']; ?>"/>
    <br />
        <br />
        <br />
        <strong>Reference Three</strong>
          <div class="applicationdivider"></div>
        <br />
        Name:
        <input type="text" name="ReferenceThreeName" id="ReferenceThreeName" value="<?php echo  $_GET['ReferenceThreeName']; ?>"/>
        <br />
        <br />
    Address:
    <input name="ReferenceThreeAddress" type="text" id="ReferenceThreeAddress" size="40" value="<?php echo  $_GET['ReferenceThreeAddress']; ?>"/>
    <br />
    <br />
    Phone Number:
    <input name="referencethreephone" type="text" id="referencethreephone" maxlength="10" value="<?php echo  $_GET['referencethreephone']; ?>"/>
    E-Mail:
    <input type="text" name="referencethreeemail" id="referencethreeemail" value="<?php echo  $_GET['referencethreeemail']; ?>"/>
    <br />
    <br />
    Business / Personal:
    <select name="BusinessPersonalThreeReference" id="BusinessPersonalThreeReference" value="<?php echo  $_GET['BusinessPersonalThreeReference']; ?>">
      <option value=" " selected="selected"> </option>
      <option value="Business">Business</option>
      <option value="Personal">Personal</option>
    </select>
    <br />
    <br />
    Years Aquainted:
    <input name="ReferenceThreeAquainted" type="text" id="ReferenceThreeAquainted" size="2" maxlength="2" value="<?php echo  $_GET['ReferenceThreeAquainted']; ?>"/>
    <br />
          </fieldset>

    <br />
    <br />

    <!-- OTHER -->  

    <fieldset>
      
    <legend class="style3">OTHER</legend> 
        <br />
        
        <div class="style8">Have you ever held a US Government Security Clearance? 
          <select name="GSC" id="GSC" value="<?php echo  $_GET['GSC']; ?>">
            <option value=" " selected="selected"> </option>
            <option value="Yes">Yes</option>
            <option value="No">No</option>
          </select>
          <strong><br />
          <br />
          </strong>Have you ever been denied a US Government Security Clearance? 
          <select name="GSCDenied" id="GSCDenied" value="<?php echo  $_GET['GSCDenied']; ?>">
            <option value=" " selected="selected"> </option>
            <option value="Yes">Yes</option>
            <option value="No">No</option>
          </select>
          <strong><br />
            </p><br />
         </fieldset>

    <div align="center"><br />
      I authorize investigation of all statements contained in this application. I understand that misrepresentation or omission of facts 
      called for is cause for dismissal. Further, I understand and agree that my employment is for no definite period and may, regardless 
      of the date of payment of my wages and salary, be terminated at any time without any previous notice.  <br />
      <br />
      <br />
    </div>
    <div align="center">
      <p>
        <input type="checkbox" name="Yes" id="Yes" value="<?php echo  $_GET['Yes']; ?>"/>
        I accept<br />
        <br />
         <a href="#" onclick="window.print()"> CLICK HERE TO PRINT YOUR APPLICATION BEFORE SUBMITTING FOR YOUR RECORDS</a></p>
      <p>&nbsp;
      
      

    <br /><?php require("ClassMathGuard.php"); MathGuard::insertQuestion(); ?> 

    <br /><?php
        $error 
    strstr($_GET['error'], 'err');
    if (
    strlen($error)) {
    echo 
    "<span style=\"font-weight:bold; color:#CC0000; background-color:#bfd1e0; border: 2px solid #80a4c0; padding: 5px; width: 500px;\">Invalid security answer. Please try again.</span>";} else {
    echo 
    " ";
    }
    ?>


    <br />
    <div style="color: red; background-color: white; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 14px;">

    </div>












    <a href="#" onclick="window.print()"><br />
        </a>
        
        
        
        
        
        
        
        
        
        <br />
        <input type="submit" name="Submit" id="Submit" value="Submit Application" />
        <br />
        <br />
        <br />
      </div>
    </div>
    </form>
    </div>
    </div>
    </body>
    </html>

  7. #7
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    And what code do you have after inserting the code I gave you?
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  8. #8
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, I figured it out.

    <option value="AL"<? if($_GET['State'] == 'AL'){ echo " SELECTED"; } ?>>AL</option>

    For future reference.

    Thanks for your help though. Much appreciated.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •