944,082 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Marked Solved
  • Views: 1176
  • ASP RSS
Oct 21st, 2009
0

dissapearing leading and trailing blanks in textbox

Expand Post »
could be this is an HTML problem, but I'll take the help anywhere I can find it...

ASP Syntax (Toggle Plain Text)
  1. <%
  2. @ Page Language = "VB" aspcompat=true Explicit="True"
  3. Dim src As String = " bet "
  4. %>
  5.  
  6. <html>
  7. <head ></head>
  8. <body >
  9.  
  10. <form name=loc action=testsac.aspx method=get>
  11. <table class=s0 width=100% cellpadding=1 cellspacing=1 align=center border=1>
  12. <tr class=s0 align=center>
  13. <td>
  14. Search For:
  15. <input class=s0 size=50 name=src value=<%=src%>>
  16. <input class=s0 type=submit value=Search />
  17. <td></td>
  18. </tr>
  19. </table>
  20. </form>
  21.  
  22. </body>
  23. </html>

on the screen, "bet" is the search string, but I want " bet "
any ideas?
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jimib is offline Offline
23 posts
since May 2009
Oct 21st, 2009
0
Re: dissapearing leading and trailing blanks in textbox
Try this:

ASP Syntax (Toggle Plain Text)
  1. Dim src As String = Chr(32) & "bet" & Chr(32)

Not sure if it will solve your problem, but it appears as though it is being trimmed (trim())...
Reputation Points: 19
Solved Threads: 9
Junior Poster in Training
sinnerFA is offline Offline
70 posts
since Sep 2009
Oct 21st, 2009
0
Re: dissapearing leading and trailing blanks in textbox
Click to Expand / Collapse  Quote originally posted by sinnerFA ...
Try this:

ASP Syntax (Toggle Plain Text)
  1. Dim src As String = Chr(32) & "bet" & Chr(32)

Not sure if it will solve your problem, but it appears as though it is being trimmed (trim())...
No, really it's a variable, which may or may not contain the leading and trailing spaces. When you assign as the value of a textbox, it is automatically trimmed. I'm looking for some kind of way to override that and leave the blanks in there.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jimib is offline Offline
23 posts
since May 2009
Oct 21st, 2009
1
Re: dissapearing leading and trailing blanks in textbox
Okay I see your issue now...

ASP Syntax (Toggle Plain Text)
  1. <html>
  2. <head ></head>
  3. <body >
  4.  
  5. <form name=loc action=testsac.aspx method=get>
  6. <table class=s0 width=100% cellpadding=1 cellspacing=1 align=center border=1>
  7. <tr class=s0 align=center>
  8. <td>
  9. Search For:
  10. <input class=s0 size=50 name=src value="&nbsp;<%=src %>&nbsp;">
  11. <input class=s0 type=submit value=Search />
  12. <td></td>
  13. </tr>
  14. </table>
  15. </form>
  16.  
  17. </body>
  18. </html>

It worked for me in Firefox 3.5
Last edited by sinnerFA; Oct 21st, 2009 at 8:14 pm.
Reputation Points: 19
Solved Threads: 9
Junior Poster in Training
sinnerFA is offline Offline
70 posts
since Sep 2009
Oct 21st, 2009
0
Re: dissapearing leading and trailing blanks in textbox
I solved this problem myself.
The answer is:
ASP Syntax (Toggle Plain Text)
  1. <input size=50 name=src value="<%=src%>">
instead of
ASP Syntax (Toggle Plain Text)
  1. <input size=50 name=src value=<%=src%>>
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jimib is offline Offline
23 posts
since May 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: ASP to ASP.NEt
Next Thread in ASP Forum Timeline: embedding objects in excel





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC