Welcome to WebmasterWorld Guest from 23.23.53.177

Forum Moderators: ocean10000

Message Too Old, No Replies

display in textbox delimited by space (ASP)

delimited text box value

   
3:27 pm on Sep 3, 2004 (gmt 0)

10+ Year Member



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>
9:33 pm on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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])

10:58 pm on Sep 3, 2004 (gmt 0)

10+ Year Member



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

11:32 am on Sep 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.

8:00 pm on Sep 4, 2004 (gmt 0)

10+ Year Member



Yes, definitely take Easy_Coder suggestion. I'd comment out the On Error and see if that was supressing an error from showing.
4:17 am on Sep 5, 2004 (gmt 0)

10+ Year Member



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.
4:50 am on Sep 5, 2004 (gmt 0)

10+ Year Member



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.

2:11 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.
3:25 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Double check for missing quotes in your controls like so:

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

7:32 am on Sep 6, 2004 (gmt 0)

10+ Year Member



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.

3:40 am on Sep 7, 2004 (gmt 0)

10+ Year Member



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