Solved

error in return code

Posted on 1999-01-13
7
152 Views
Last Modified: 2010-04-09
when this line is ran it quits after the space in the item being returned(cursor.AGNT_ADDRESS).  so if "Billings Street" is in the  database "Billings" is the only thing printed in the box.  any ideas ??
TIA
 
    <SERVER>
    write("<TD WIDTH=240><INPUT id=FormsEditField2 TYPE=text NAME=address1 VALUE="+escape(cursor.AGNT_ADDRESS)+"
    SIZE=30 MAXLENGTH=30></TD>");
    </SERVER>
0
Comment
Question by:craigs052998
  • 3
  • 2
  • 2
7 Comments
 

Expert Comment

by:MagicJ
Comment Utility

    <SERVER>
    write("<TD WIDTH=240><INPUT id=FormsEditField2 TYPE=text NAME=address1 VALUE='" + cursor.AGNT_ADDRESS + "'
    SIZE=30 MAXLENGTH=30></TD>");
    </SERVER>
escape() function will just replace all the occurences of special chars by it's Hex equivalent. In the text box u don't want a hex char to be seen. Try putting a single quote before and after the string as shown above and let me know.

Best of Luck
0
 
LVL 3

Accepted Solution

by:
idt earned 50 total points
Comment Utility
Craigs,

when your line is send to the browser, it reads

<TD WIDTH=240><INPUT id=FormsEditField2 TYPE=text NAME=address1 VALUE=Billings Street SIZE=30 MAXLENGTH=30></TD>

So.. the browser interprets Street as a new argument that it doesn't know, so ignores it

The 'trick is to surround your info with quotes, the easiest is single quotes:

write("<TD WIDTH=240><INPUT id=FormsEditField2 TYPE=text NAME=address1 VALUE="+"'"+cursor.AGNT_ADDRESS+"'"+" SIZE=30 MAXLENGTH=30></TD>");

Then the browser will recieve
<TD WIDTH=240><INPUT id=FormsEditField2 TYPE=text NAME=address1 VALUE='Billings Street' SIZE=30 MAXLENGTH=30></TD>

you may also try ...VALUE="+'"'+curs... to surround the data with double quotes, but such code does not work in all server environments

-iDT
"God is real, unless specifically defined as an integer"
0
 
LVL 3

Expert Comment

by:idt
Comment Utility
The E.E. server does some quote stripping of its own..
the line of code I sent should read:

.address1 VALUE=" + " <singlequotehere> "+cursor.AGNT_ADDRESS + " <singlequotehere> " + " SIZE=30 ...

I hope that's legible.. :)

-iDT
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:craigs052998
Comment Utility
adding the single quote did it
0
 

Expert Comment

by:MagicJ
Comment Utility
Hi Craigs,

This is very unfair, I send u the same answer and u accepted idt's answer. Please read my comment if u have time to do so.

Best Of Luck...
0
 

Author Comment

by:craigs052998
Comment Utility
I went with who answered it first not as a comment.  In the past I had problems with people taking one persons comment and answering it as theirs.  So I give the points to the first one to answer it, not comment it, and have to refuse and reopen the the first one that did it as a comment.  That sounded confusing but I think you got the idea.

And yes yours did the same thing
0
 
LVL 3

Expert Comment

by:idt
Comment Utility
Sorry MagicJ, when I read your comment I really thought you misunderstood his question and thought the escape() function contributed to his problem.

I know it is frustrating when an answer seems to be posted as an end run.

regards
-iDT
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now