[thelist] Frustrated - why does this code produce error at load?
Brian Delaney
Brian.Delaney at mccmh.net
Wed Apr 6 06:44:28 CDT 2005
oops! The line should read:
response.write "agencynamearray[" & intCount & "] = " & strName & chr(13)
I added the ";" hoping it would help.
The response.writes are on two seperate lines.
Thanks
---------- Original Message ----------------------------------
From: Brian Cummiskey <Brian at hondaswap.com>
Reply-To: "thelist at lists.evolt.org" <thelist at lists.evolt.org>
Date: Tue, 05 Apr 2005 15:32:43 -0400
>Brian Delaney wrote:
>> thanks for that, but now the error has moved to the line when I populate
>> the array - this line:
>>
>> response.write "agencynamearray[" & intCount & "] = " & strName & ";"
>> & chr(13)
>>
>> same error - expected ';'
>>
>> thanks
>
>here's the code you pasted:
>
>function getAgencyName(frmIncident)
> {
>.
>.
>.
> response.write "agencynamearray[" & intCount & "] = " &
>strName & ";" & chr(13) response.write "agencycodearray[" &
>intCount + 1 & "] = " & strCode & ";" & chr(13)
>.
>.
>.
>} //end function
>
>
>now, i don't know if it just didn't copy correctly... but if you start
>another response.write statement on the same line, it will trigger an
>asp error.
>
>here's what i would do to test:
>
>break out the asp.
>
>run your sql command.
>copy/paste your results into the JS loop and see what you come up with.
> there's a good chance your sql isn't formatting correctly-- and with
>the hard coded ";" hanging out in there, i can see it being a problem.
>
>also, try using & VbCrLf or & "\r\n" instead of & Chr(13), at least to
>test. i'm not sure if JS will pick up on it the same way or not.
>
>
>a quick fill in yields the following:
>
>response.write "agencynamearray[0] = TheNameHere;" & chr(13)
>response.write "agencycodearray[0] = TheCodeHere;" & chr(13)
>
>Now, throw that in your JS loop with the asp assumed processed...
>
>
>function getAgencyName(frmIncident)
> {
> var agencynamearray() = new Array;
> var agencycodearray() = new Array;
>
> agencynamearray[0] = TheNameHere;
> agencycodearray[0] = TheCodeHere;
>
> for (i=0; i<1; i++)
> {
> if (frmIncident.txtAgencyCode.value == agencycodearray[i])
> {
>frmIncident.txtAgencyName.Value = agencynamearray[i];
> } //end if
> } //end for
>} //end function
>
>
>
>
>Some things to check are the arrary strings. you may be missing a set
>of quotes.
>
>
>response.write "agencynamearray[0] = TheNameHere;" & chr(13)
>might need to be:
>response.write "agencynamearray[0] = ""TheNameHere"";" & chr(13)
>or something to that extent.
>
>its kinda hard to test with out the DB data to play with. give it a shot.
>
>-Brian
>
>
>
>
>--
>
>* * Please support the community that supports you. * *
>http://evolt.org/help_support_evolt/
>
>For unsubscribe and other options, including the Tip Harvester
>and archives of thelist go to: http://lists.evolt.org
>Workers of the Web, evolt !
>
*
*
*
This message, including any attachments, is intended solely for the use of the named recipient(s) and may contain confidential and/or priveleged information. Any unauthorized review, use, disclosure or distribution of this communication(s) is expressly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy any and all copies of the original message.
More information about the thelist
mailing list