Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

error in return code

Posted on 1999-01-13
7
156 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
ID: 1841657

    <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
ID: 1841658
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
ID: 1841659
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:craigs052998
ID: 1841660
adding the single quote did it
0
 

Expert Comment

by:MagicJ
ID: 1841661
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
ID: 1841662
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
ID: 1841663
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

790 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