homepage Welcome to WebmasterWorld Guest from 54.205.241.107
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
display in textbox delimited by space (ASP)
delimited text box value
Skipper

10+ Year Member



 
Msg#: 2124 posted 3:27 pm on Sep 3, 2004 (gmt 0)

My statement is in a table. My data is coming from an Access table. It all looks good except when I try to display it in a text box - it stops with the first space in the field. I tried CStr with no luck. Any help would be appreciated. The code follows:
<td align="left">
<input name="txt_address1" width="40" type="text" ID="Text2" value=<%Response.Write(CStr(rs_faf2("faf_address1")))%>>
</td>

 

mattglet

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2124 posted 9:33 pm on Sep 3, 2004 (gmt 0)

Welcome to WebmasterWorld Skipper!

If you're not getting an actual error, make sure that field actually has data in it (open the database, and check to see if that field is not blank). If you do have actual data there, and it's just not showing, please paste your SQL query. (No URL's though [webmasterworld.com])

Skipper

10+ Year Member



 
Msg#: 2124 posted 10:58 pm on Sep 3, 2004 (gmt 0)

Thank you for looking.

There is data. When I do a view source, I see the full address which is 724 Scottish Mist, but it only displays 724 in the textbox. At any rate here is the sql

SQLStmt = "Select"
SQLStmt = SQLStmt + " faf.lname as faf_lname, "
SQLStmt = SQLStmt + " faf.fname as faf_fname, "
SQLStmt = SQLStmt + " faf.address1 as faf_address1, "
SQLStmt = SQLStmt + " faf.address2 as faf_address2, "
SQLStmt = SQLStmt + " faf.city as faf_city, "
SQLStmt = SQLStmt + " faf.state as faf_state, "
SQLStmt = SQLStmt + " faf.zip as faf_zip,"
SQLStmt = SQLStmt + " faf.phone as faf_phone, "
SQLStmt = SQLStmt + " faf.cell as faf_cell, "
SQLStmt = SQLStmt + " faf.email as faf_email, "
SQLStmt = SQLStmt + " faf.work as faf_work,"
SQLStmt = SQLStmt + " faf.wphone as faf_wphone, "
SQLStmt = SQLStmt + " faf.birthday as faf_birthday, "
SQLStmt = SQLStmt + " faf.anniv as faf_anniv, "
SQLStmt = SQLStmt + " faf.notes as faf_notes "
SQLStmt = SQLStmt + " from faf "
SQLStmt = SQLStmt + " where faf.lname = '" & selected_lname & "'"
SQLStmt = SQLStmt + " and faf.fname = '" & selected_fname & "'"

rs_faf2.Open SQLStmt, connection

on error resume next

Easy_Coder

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2124 posted 11:32 am on Sep 4, 2004 (gmt 0)

That sounds pretty odd...

How are you handling any errors once 'On Error Resume Next' executes? Maybe an error is attempting to bubble up and it's getting supressed.

macrost

10+ Year Member



 
Msg#: 2124 posted 8:00 pm on Sep 4, 2004 (gmt 0)

Yes, definitely take Easy_Coder suggestion. I'd comment out the On Error and see if that was supressing an error from showing.

Skipper

10+ Year Member



 
Msg#: 2124 posted 4:17 am on Sep 5, 2004 (gmt 0)

I did as you suggested but there is no error. I did a response.write on the err and it was 0. I also did a response.write on the field and it displayed correctly. It only seems to be delimited by the space when it is in textbox.

Skipper

10+ Year Member



 
Msg#: 2124 posted 4:50 am on Sep 5, 2004 (gmt 0)

I just went back and reread a statement I made earlier: There is data. When I do a view source, I see the full address which is 724 Scottish Mist, but it only displays 724 in the textbox.

If the server is rendering the correct value for the text box it sounds like it could be internet explorer that is not displaying it, no? I am using IE 6.0 with the latest updates.

mattglet

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2124 posted 2:11 pm on Sep 5, 2004 (gmt 0)

Can you paste your source view, to show what you're talking about? I have a couple of ideas that might come to light from seeing your browser source.

Easy_Coder

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2124 posted 3:25 pm on Sep 5, 2004 (gmt 0)

Double check for missing quotes in your controls like so:

<input type="text" name="simpleControl" value="Test>

musicales

10+ Year Member



 
Msg#: 2124 posted 7:32 am on Sep 6, 2004 (gmt 0)

You need quotes rpound the value as in

value="<%Response.Write(CStr(rs_faf2("faf_address1")))%>">

otherwise the value stops at the first space and the rest is treated as part of the tag text.

Skipper

10+ Year Member



 
Msg#: 2124 posted 3:40 am on Sep 7, 2004 (gmt 0)

That was it. I was missing the quotes around the value=. Thank you very much.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved