Solved

error in return code

Posted on 1999-01-13
7
155 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
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).

803 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