For all of your programming needs and wants.


    [Help me] PHP on Form Text Box Default Value

    Share

    ranga227
    Stranger
    Stranger

    Posts : 3
    Join date : 2009-07-04

    [Help me] PHP on Form Text Box Default Value

    Post by ranga227 on 7/4/2009, 11:21 pm

    Here is the code I use to get display name:

    Code:
    <?php echo '' . $row['members_display_name'] . ''; ?>

    Eg: Output is Haris

    I want display output on textbox default value, I tried it like this

    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?
    avatar
    SoulRed12
    Moderator
    Moderator

    Posts : 129
    Join date : 2009-05-08
    Age : 26
    Location : West-coast USA

    Re: [Help me] PHP on Form Text Box Default Value

    Post by SoulRed12 on 7/7/2009, 1:03 pm

    I don't know if you can just open the php mid-tag like that.

    Try

    Code:
    <?php
    echo("<input value=\"".$row['members_display_name']."\" type=\"text\" class=\"text_user\" id=\"nick\" MAXLENGTH=\"25\" />");
    ?>

    Also your use of a space may have been causing problems ("text user" instead of "text_user"). I haven't programmed a website in ages so I don't really remember for sure all the little things html is picky about.

    If this doesn't work, make sure the file is actually a php file, and that you're viewing it after it has been uploaded rather than while it's still on your computer.
    avatar
    Omegrakai
    Stranger
    Stranger

    Posts : 19
    Join date : 2009-06-06

    Re: [Help me] PHP on Form Text Box Default Value

    Post by Omegrakai on 7/12/2009, 12:33 am

    THATS why I'll never will learn Php.

    Sponsored content

    Re: [Help me] PHP on Form Text Box Default Value

    Post by Sponsored content


      Current date/time is 9/20/2017, 12:26 pm