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.

PHP Forum


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



Freelance Jobs

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
 
 
Register now for full access!
Old 07-03-2009, 09:41 AM Re: [Help me] PHP on Form Text Box Default Value
EdB
Skilled Talker

Posts: 79
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?
__________________

Please login or register to view this content. Registration is FREE
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

Posts: 2,781
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 07-04-2009 at 02:47 PM..
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
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">
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
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

Posts: 2,781
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">
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
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.15873 seconds with 12 queries