Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Trouble assigning value containing special characters to text box
Old 12-21-2008, 07:06 AM Trouble assigning value containing special characters to text box
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
I am assigning a value to a text box, the value may contain special characters such as an apostorphe, I just can't get it! the values are taken from a database via php. for example: $Text = "this ' is ' a ' test" of course if I use

<?php
echo "<input type='text' value = $Text/>"
?>

The result in my text box is "this "

How can I get this done?
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-21-2008, 07:35 AM Re: Trouble assigning value containing special characters to text box
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Use a correctly formatted attribute value that is enclosed in quotemarks, otherwise the spaces (and the apostrophes) become the value delimiters ( a space is a delimiter in HTML)

echo "<input type=\"text\" value =\"$Text\"/>"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-21-2008, 07:43 AM Re: Trouble assigning value containing special characters to text box
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Thx Chris, just could not get my head around it. Do you ever sleep?
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Trouble assigning value containing special characters to text box
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12288 seconds with 12 queries