SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    455
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    setting form value with a variable

    I've tried:

    value=".$margin3."
    value="$margin3"
    value=$margin3

    ,but no joy.

    I must be dancing around the answer. What's the script to assign a form value with a variable please?

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    Need just a bit more context than that. Where is this being executed? Inside an echo? Inside or outside of a PHP block?

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    455
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That worked. Doooo!

    value="'.$margin3.'"

    Thanks for your help during a senior moment StarLion.

    Niche

  4. #4
    SitePoint Zealot GOPalmer's Avatar
    Join Date
    Jan 2009
    Location
    Wiltshire, UK
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML input value?

    Code HTML4Strict:
    <input type="text" value="<?= $margin3; ?>" />

  5. #5
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    455
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't understand that notation. What does it mean?

  6. #6
    SitePoint Zealot GOPalmer's Avatar
    Join Date
    Jan 2009
    Location
    Wiltshire, UK
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You won't need to do that as it looks like you're echoing the HTML, but it's that same as:

    PHP Code:
    <?php echo $margin3?>

  7. #7
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    455
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Gotch ya.

    Thanks,

    Niche


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •