Assigning Text to a Text box

Hi, I am trying to assign a string to a text box using the following statement:

<INPUT id=txtMCat name=txtMCat style="HEIGHT: 22px; WIDTH: 258px" value=<%= Server.HTMLEncode(myVal)%> >

This works, sort off, the problem is that if the string consists of more than one word only the first word is displayed in the textbox.

Anybody can tell me what I'm doing wrong.
I'm quite new to HTML and dont have a lot of time to try and figure it out on my own (Demo monday).

Thnx
LVL 2
VerolandAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jamestthomasCommented:
Not sure why you are htmlencoding it, try it without.
0
VerolandAuthor Commented:
It's not the HTMLencode thats giving the problems, it does it even if I take the HTMLEncode out
0
KennyIT Application ExecutiveCommented:
put quote marks (") around it.

Should work for more than 1 word with it.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

VerolandAuthor Commented:
I've tried that, it didn't work
0
KennyIT Application ExecutiveCommented:
You put the " outside the angled brackets?
0
KennyIT Application ExecutiveCommented:
I mean as in :

value="<%= Server.HTMLEncode(myVal)%>" > 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VerolandAuthor Commented:
Thank you very much
0
jamestthomasCommented:
That was my first thought DARN IT.  I always do that with text firleds.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.