Reply
[Help me] PHP on Form Text Box Default Value
Old 07-03-2009, 04:53 AM [Help me] PHP on Form Text Box Default Value
Haris's Avatar
Novice Talker

Posts: 11
Name: Ali Haris
Trades: 0
Here is the code I use to get display name:
PHP Code:
<?php echo '' $row['members_display_name'] . ''?>
Eg: Output is Haris

I want display output on textbox default value, I tried it like this
PHP Code:
<input value="<?php echo '' $row['members_display_name'] . ''?>" type="text" class="text user" id="nick" MAXLENGTH="25" />
But it didn't work

Can anyone help me to display username on value?
Haris is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-03-2009, 09:41 AM Re: [Help me] PHP on Form Text Box Default Value
EdB
Skilled Talker

Posts: 64
Name: Ed Barnett
Trades: 0
What HTML output do you get using that second line of code? Does it have to have the spaces at both ends of the code?
__________________
Printer Cartridges Cardiff
EdB is offline
Reply With Quote
View Public Profile Visit EdB's homepage!
 
Old 07-04-2009, 02:45 PM Re: [Help me] PHP on Form Text Box Default Value
NullPointer's Avatar
Will Code for Food

Latest Blog Post:
Easy PHP Search with Opera
Posts: 1,070
Name: Matt
Location: Irvine, CA
Trades: 0
Post more of your code. Also, you don't need to append the value to the empty string
PHP Code:
echo $row['members_display_name']; 
should work fine.
__________________
Tinsology | How to Post Code | EverythingDev

Last edited by NullPointer; 07-04-2009 at 02:47 PM..
NullPointer is online now
Reply With Quote
View Public Profile
 
Old 07-07-2009, 04:10 AM Re: [Help me] PHP on Form Text Box Default Value
Novice Talker

Posts: 5
Name: gaurav
Trades: 0
I am trying to keep a default text in a text box. But if I try to use couple of words having spase in between it just only taking the first word. I want to show the couple of words in the text box. How can I do that?

Here is my code...... I am passing the sentence through $Name
$Name = "Hello World";

But it's unly showing "Hello" in the text box.
Quote:
<input type="text" name="Domain_Name[]" value = <?php print "$Name";?> size = "30">
gkumar is offline
Reply With Quote
View Public Profile
 
Old 07-07-2009, 05:36 AM Re: [Help me] PHP on Form Text Box Default Value
NullPointer's Avatar
Will Code for Food

Latest Blog Post:
Easy PHP Search with Opera
Posts: 1,070
Name: Matt
Location: Irvine, CA
Trades: 0
Quote:
Originally Posted by gkumar View Post
I am trying to keep a default text in a text box. But if I try to use couple of words having spase in between it just only taking the first word. I want to show the couple of words in the text box. How can I do that?

Here is my code...... I am passing the sentence through $Name
$Name = "Hello World";

But it's unly showing "Hello" in the text box.
For future reference, you should only ask a question like this in a thread if you are having pretty much the same issue. In your case your question is completely unrelated.

Your html is invalid, your code results in:

Code:
<input type="text" name="Domain_Name[]" value = Hello World size = "30">
Try:

PHP Code:
<input type="text" name="Domain_Name[]" value="<?php print $Name?>" size="30">
__________________
Tinsology | How to Post Code | EverythingDev
NullPointer is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to [Help me] PHP on Form Text Box Default Value
 

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.15139 seconds with 13 queries