As Ben has noted, the hidden field should have pound signs to be recognized, but this leads to the following, real, issue:

Your form tag is the following:

<form action=""
method="post">

It's a "post" (meaning all passed variables are accessible via the FORM scope).

So on the page that accepts this submit, you have to check for "FORM.personnelkey", NOT "URL.personnelkey" - different scope.

To get around this, you can call this hidden variable "URL.personnelkey" but that's not good programming practice.

This should fix things for you

>OK, there's good news and bad news --
>
>I got my URL to pass along the ID number I was looking
>for -- thanks! -- but I'm pretty sure it's not getting
>passed as a number because I got suspicious and
>created an action page with one line
>
><cfoutput>#URL.PersonnelKey#</cfoutput>
>
>and I'm getting this error message:
>
>Element PERSONNELKEY is undefined in URL.
>
>Is my syntax wrong? I'm still using the same URL as
>below:
>
>http://localhost:8500/InfoCenter/Parking/addpermitv_test.cfm?PersonnelKey=21486
>
>and the SQL is the same as well. The form page code is
>below, in case that's where I'm messing things up.
>
>Geez, I wanted to have this finished today -- I guess
>that's not going to happen :(
>
>Thanks,
>
>Laura
>=========================================
>Laura Schlee
>DML Associates
>cell 703-622-0363
>ofc  202-685-1360
>
>
>
>
><!-- Check for the existence of the PersonnelKey value
>-->
><cfif NOT IsDefined  ("URL.PersonnelKey")>
><!-- If the PersonnelKey value is not available, send
>the user to the
>"search for a person" page -->
><cflocation url=""> ></cfif>
>
><html>
><head>
><title>Add a Permit - Vehicle Table</title>
></head>
><body bgcolor="#FFFFFF">
><p>
><h2>Add Vehicle Information to Personnel Record</h2>
></p>
><form action=""> >method="post">
>
><!-- Embed PersonnelKey as a hidden field -->
>
><cfoutput>
><input type="hidden" name="PersonnelKey"
>value="URL.PersonnelKey">
></cfoutput>
>
>  <table width="650" border="1" cellspacing="0"
>cellpadding="0">
>    <tr>
>      <td colspan="2"><b>Car Information</b></td>
>      <td width="144">�</td>
>      <td width="153">�</td>
>      <td width="118">�</td>
>      <td width="81">�</td>
>    </tr>
>    <tr>
>      <td width="96">�</td>
>      <td width="44">�</td>
>      <td width="144">�</td>
>      <td width="153">�</td>
>      <td width="118">�</td>
>      <td width="81">Year</td>
>    </tr>
>    <tr>
>      <td width="96">Tag Number</td>
>      <td width="44">State</td>
>      <td width="144">Make</td>
>      <td width="153">Model</td>
>      <td width="118">Color</td>
>      <td width="81">(YYYY)</td>
>    </tr>
>    <tr>
>      <td width="96">
>        <input type="text" name="TagNumber" size="10"
>maxlength="10">
>      </td>
>      <td><select name="TagState">
>   <option value="AL">AL</option>
>   <option value="AK">AK</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="DC">DC</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>
>   </select>
>      </td>
>      <td width="144">
>        <input type="text" name="Make" size="20"
>maxlength="20">
>      </td>
>      <td width="153">
>        <input type="text" name="Model" size="20"
>maxlength="20">
>      </td>
>      <td width="118">
>        <input type="text" name="Color" size="20"
>maxlength="20">
>      </td>
>      <td width="81">
>        <input type="text" name="CarYear" size="10"
>maxlength="10">
>      </td>
>    </tr>
>    <tr>
>      <td width="96">�</td>
>      <td width="44">�</td>
>      <td width="144">�</td>
>      <td width="153">�</td>
>      <td width="118">�</td>
>      <td width="81">�</td>
>    </tr>
>    <tr>
>      <td width="96"><b>DOD Decal Information</b></td>
>      <td width="44">�</td>
>      <td width="144">�</td>
>      <td colspan="2"><b>Insurance
>Information</b></td>
>      <td width="81">�</td>
>    </tr>
>    <tr>
>      <td width="96">�</td>
>      <td width="44">�</td>
>      <td width="144">�</td>
>      <td width="153">�</td>
>      <td width="118">�</td>
>      <td width="81">Insurance</td>
>    </tr>
>    <tr>
>      <td width="96">Decal</td>
>      <td colspan="2">
>        <table width="188" border="0" cellspacing="0"
>cellpadding="0">
>          <tr>
>            <td>Decal</td>
>            <td>Decal</td>
>          </tr>
>        </table>
>      </td>
>      <td width="153">Insurance</td>
>      <td width="118">Policy</td>
>      <td width="81">Expiration</td>
>    </tr>
>    <tr>
>      <td width="96"> Number</td>
>      <td colspan="2">
>        <table width="188" border="0" cellspacing="0"
>cellpadding="0">
>          <tr>
>            <td>Color</td>
>            <td>Expiration</td>
>          </tr>
>        </table>
>      </td>
>      <td width="153">Company</td>
>      <td width="118">Number</td>
>      <td width="81">MMDDYY</td>
>    </tr>
>    <tr>
>      <td width="96">
>        <input type="text" name="DODDecalNumber"
>size="15" maxlength="15">
>      </td>
>      <td colspan="2">
>     <table width="188" border="0" cellspacing="0"
>cellpadding="0">
>          <tr>
>            <td>
>              <input type="text" name="DODDecalColor"
>size="15" maxlength="15">
>            </td>
>            <td>
>              <input type="text"
>name="DODDecalExpiration" size="15" maxlength="15">
>            </td>
>          </tr>
>        </table>
>   </td>
>      <td width="153">
>        <input type="text" name="InsuranceCompany"
>size="20" maxlength="20">
>      </td>
>      <td width="118">
>        <input type="text" name="PolicyNumber"
>size="20" maxlength="20">
>      </td>
>      <td width="81">
>        <input type="text"
>name="InsuranceExpirationDate" size="10"
>maxlength="10">
>      </td>
>    </tr>
>    <tr>
>      <td>�</td>
>      <td colspan="2">�</td>
>      <td>�</td>
>      <td>�</td>
>      <td>�</td>
>    </tr>
>    <tr>
>      <td><strong>Permit Info</strong></td>
>      <td colspan="2">�</td>
>      <td>�</td>
>      <td>�</td>
>      <td>�</td>
>    </tr>
>    <tr>
>      <td>�</td>
>      <td colspan="2">�</td>
>      <td>�</td>
>      <td>Permit</td>
>      <td>Validated</td>
>    </tr>
>    <tr>
>      <td>Issued By</td>
>      <td colspan="2">Permit Number</td>
>      <td>Issued Date</td>
>      <td>Expiration</td>
>      <td>Content?</td>
>    </tr>
>    <tr>
>      <td><input type="text" name="IssuedBy" size="20"
>maxlength="20"></td>
>      <td colspan="2"><input type="text"
>name="PermitNumber" size="20" maxlength="20"></td>
>      <td><input type="text" name="IssuedDate"
>size="20" maxlength="20"></td>
>      <td><input type="text" name="ExpirationDate"
>size="20" maxlength="20"></td>
>      <td><input type="checkbox"
>name="CarValidateContentFlag" value="-1"></td>
> </tr>
>  </table>
>
>  <p>
>    <input type="submit" value="Submit">
>  </p>
></form>
><p>
></body>
></html>
>> >
>> >SQL    INSERT INTO Vehicles(PersonnelKey, Year,
>> Make,
>> >Model, Color, TagNumber, TagState, DecalNumber,
>> >DecalColor, DecalExpiration, InsuranceCompany,
>> >PolicyNumber, InsuranceExpirationDate,
>> PermitNumber,
>> >IssuedBy, IssueDate, ExpirationDate)
>> >VALUES('URL.PersonnelKey', '1982', 'Chrome
>> Wheeled',
>> >'Fuel Injected', 'Black', '174CZP', 'AL', '47',
>> >'white', '70303', 'State Farm', '42787', '123004',
>> >'477', 'ted', '111202', '111204')
>> >
>> >The first value to be inserted is supposed to be
>> the
>> >id number passed along from the previous page --
>> which
>> >at this point is NOT getting passed along -- which
>> >makes me wonder if these two issues are connected.
>> >Here is the full code for the page giving this
>> error
>> >message:
>> >
>> ><!-- Initialize variable -->
>> ><CFPARAM NAME="FORM.CarValidateContentFlag"
>> >DEFAULT="0">
>> >
>> ><html>
>> ><head>
>> ><title>Add Permit Action Form</title>
>> ><meta http-equiv="Content-Type" content="text/html;
>> >charset=iso-8859-1">
>> ></head>
>> ><body bgcolor="#FFFFFF">
>> >  <p>
>> >   <font face="Arial, Helvetica, sans-serif"
>> >size="+2">Add Permit Action Form</font>
>> >  </p>
>> >    <cfquery name="AddVehicle"
>> >datasource="CMISPersonnel">
>> > INSERT INTO Vehicles(PersonnelKey, Year, Make,
>> Model,
>> >Color, TagNumber, TagState,
>> >   DODDecalNumber, DODDecalColor,
>> DODDecalExpiration,
>> >InsuranceCompany, PolicyNumber,
>> >    InsuranceExpirationDate, PermitNumber,
>> IssuedBy,
>> >IssueDate, ExpirationDate)
>> >    <!-- temporarily commented out
>> >ValidateContentFlag) -->
>> > VALUES('#PersonnelKey#', '#Trim(FORM.Year)#',
>> >'#Trim(FORM.Make)#', '#Trim(FORM.Model)#',
>> > '#Trim(FORM.Color)#', '#Trim(FORM.TagNumber)#',
>> >'#Trim(FORM.TagState)#',
>> > '#Trim(FORM.DODDecalNumber)#',
>> >'#Trim(FORM.DODDecalColor)#',
>> >'#Trim(FORM.DODDecalExpiration)#',
>> >   '#Trim(FORM.InsuranceCompany)#',
>> >'#Trim(FORM.PolicyNumber)#',
>> >'#Trim(FORM.InsuranceExpirationDate)#',
>> >   '#Trim(FORM.PermitNumber)#',
>> >'#Trim(FORM.IssuedBy)#', '#Trim(FORM.IssuedDate)#',
>> >'#Trim(FORM.ExpirationDate)#')
>> > <!-- Temporarily commented out
>> >'#FORM.CarValidateContentFlag#') -->
>> >
>> ></cfquery>
>> ><cfoutput>
>> >The new permit information has been submitted.
>> Please
>> >make another selection
>> >from the menu to continue.
>> ></cfoutput>
>> ></body>
>> ></html>
>
>
>__________________________________
>Do you Yahoo!?
>The New Yahoo! Shopping - with improved product search
>http://shopping.yahoo.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to