The <cfform> tag is closed in the actual code, but it must have lost the
bracket when I copied it. As for the parameterexists(), can you tell that
someone started creating this form a LONG time ago? LOL.

Here's the code from the browser (edited since the form contains more info
than what is needed here):
<script language="_javascript_">
<!--
var aryTravelers = new Array();

aryTravelers[aryTravelers.length] = new Array(257, "222-22-2222",
"asdfasfsfsfasd");

aryTravelers[aryTravelers.length] = new Array(183, "111-11-1111", "3333
assss rd.

aryTravelers[aryTravelers.length] = new Array(122, "111-22-3333",
"asdfasdfasdfasdf kkk");

aryTravelers[aryTravelers.length] = new Array(333, "111-21-2323",
"asdfasdfasdfasdf");

aryTravelers[aryTravelers.length] = new Array(125, "777-77-7777",
"asdfasdfasdf");

//--->
</script>

<script language="_javascript_">
<!--
function DisplaySSN(aryTravelers) {

var objTraveler = document.all("idTraveler");
var objSSN = document.all("idSSN");

var iTraveler = objTraveler.options[objTraveler.selectedIndex].value;
for (var i=0; i<aryTravelers.length; i++)
{
var aryX = aryTravelers[i];

if (aryX[0] == iTraveler)
//var sSSN = aryX[1];
   objSSN.value = aryX[1]
}

}

//-->
</script>

<script LANGUAGE=_javascript_ TYPE="text/_javascript_" >

<!--

function  _CF_checkCFForm_1(_CF_this)

    {

    return true;

    }

//-->

</script>

<script LANGUAGE=_javascript_ TYPE="text/_javascript_" >

<!--

function  _CF_checkCFForm_2(_CF_this)

    {

    return true;

    }

//-->

</script>

<FORM NAME="TravelProcess" ACTION="" METHOD=POST>

<table width="640" align="center"
<tr>
<td bgcolor="ffffff">
<table width="640" align="center" bgcolor="ffffff">
<tr>
<td align="right" class="copybold">Name:</td><td align="left" valign="top">

<select name="Traveler" class="formfield" id="idTraveler"
> <option value=""></option>

<option value="257" >KeAnne Hoeg</option>

<option value="183" >Kevin Grayson</option>

<option value="122" >Kristine Swiatocho</option>

<option value="333" >Kurt Creamer</option>

<option value="125" >Lisa Geisler</option>

</select>
</td>

<td align="right" class="copybold">SSN:</td>
<td align="left" valign="top">

<input type="text" name="SSN" value="" size="12" maxlength="11"
class="formfield" id="idSSN">

</td>
</tr>
</table>
</td>
</tr>
</table>
</Form>

>From: Charlie Griefer <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: Re: Array Help
>Date: Tue, 7 Sep 2004 06:42:03 -0700
>
>Be easier to troubleshoot this if you could post the actual HTML from
>the browser.
>
>Not sure if this might be the problem...your <cfform> tag isn't closed
>(no ">") ?
>
>...also, parameterExists() has been deprecated since roughly CF 3
>(somebody will likely correct me if i'm wrong there...but it's been a
>while).  you really shouldn't be using it anymore.  Since you use
>isDefined("TravelID") right above it, I'd change your
>      <cfif parameterexists(travelID)>
>to
>      <cfif holdIDExists>
>which, based on your <cfset> above should work; and would be
>preferrable to parameterexists.
>
>On Tue, 07 Sep 2004 08:46:41 -0400, KeAnne Hoeg <[EMAIL PROTECTED]>
>wrote:
> > I have a form on which I am trying to populate a few text boxes with SSN
>and address based on the name selected in a drop-down box.  I can see that
>the array was created successfully, but I am having problems getting the
>selected value to work with the array to find the SSN and address. The
>error message says that the array value is undefined. Part of the problem
>is that I borrowed this _javascript_ code from code we were already using, so
>I don't understand why I can't get it to work.  Any help would be greatly
>appreciated!  Here is the code:
> >
> > Thanks,
> >
> > KeAnne
> >
> > <CFQUERY DATASOURCE="IESForms" NAME="TravelerInfo">
> >         SELECT  TravelerID, SSN, Deliver, PreferredName, LastName
> >         FROM    vwTravelerInfo
> >         ORder by PreferredName
> > </CFQUERY>
> > <script language="_javascript_">
> > <!--
> > var aryTravelers = new Array();
> > <cfoutput query="TravelerInfo">
> > aryTravelers[aryTravelers.length] = new Array(#TravelerID#, "#SSN#",
>"#Deliver#");
> > </cfoutput>
> > //--->
> > </script>
> >
> > <script language="_javascript_">
> > <!--
> > function DisplaySSN(aryTravelers) {
> >
> >         var objTraveler = document.all("idTraveler");
> >         var objSSN = document.all("idSSN");
> >
> >         var iTraveler =
>objTraveler.options[objTraveler.selectedIndex].value;
> >         for (var i=0; i<aryTravelers.length; i++)
> >         {
> >                 var aryX = aryTravelers[i];
> >
> >                 if (aryX[0] == iTraveler)
> >                 objSSN.value = aryX[1]
> >         }
> >
> > }
> >
> > //-->
> > </script>
> >
> >  <CFSET HoldIDExists = #IsDefined("TravelID")#>
> >
> >  <cfif parameterexists(TravelID)>
> >
> >    <cfset LoopCondition =2>
> >
> >  <cfelse>
> >  <cfset LoopCondition=1>
> >  </cfif>
> >
> >   <!---new record--->
> >   <CFIF LoopCondition is 1>
> >     <CFSET ButtonText = "Save">
> >     <cfset NewRecord="yes">
> >         <cfset Traveler="">
> >         <cfset SSN="">
> > </cfif>
> >
> > <cfform action="" name="TravelProcess"
> >
> > <select name="Traveler" class="formfield" id="idTraveler"
>> > > <option value=""></option>
> > <cfoutput query="TravelerInfo">
> > <option value="#TravelerID#" >#PreferredName# #LastName#</option>
> > </cfoutput>
> >
> > </select>
> >
> > <cfoutput>
> > <input type="text" name="SSN" value="#SSN#" size="12" maxlength="11"
>class="formfield" id="idSSN">
> > </cfoutput>
> >
> > </cfform>
> >
> >
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to