Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

error in return code

Posted on 1999-01-13
7
Medium Priority
?
160 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
[X]
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
  • 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 200 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

604 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