We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4966
    • 143 Posts
    Don’t know if this is really ModX. I have created a form that allows the user to edit user information gathered from a guestbook form. The form display the values from the database. The problem I have is that one of the fields only display the first word. When I look at view source I see that the entire field is there. The field is a name field where only the first word is displayed. I tried formatting the field and all but made no difference.

    charlie-imac
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If the entire text is actually in the field, then I would take a long, hard look at the CSS file.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4966
        • 143 Posts
        I did look at the css but couldn’t see anything that would effect the form fields. Here is the code from view source. I just can’t figure out why the entire value is not showing in the form field. Note, the field values are coming from the database.

        <head>
        <title>MODx</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="media/style/MODxLight/style.css?" />
        </head>
        <body>


        <div class="sectionHeader">Koops Mailinglist - &copy; 2006 </div><div class="sectionBody">
        <div class="searchbar">
        <img src="media/style/MODxLight/images/misc/dot.gif" align="absmiddle" />&nbsp;&nbsp;&nbsp;<b>Admin Menu</b>&nbsp;&nbsp;&nbsp;<a href="index.php?a=112&id=3&p=0"> Home</a> | <a href="index.php?a=112&id=3&p=1">Send Mail</a> | <a href="index.php?a=112&id=3&p=4">Subscribers</a> | <a href="index.php?a=112&id=3&p=9">mailLabel1</a> | <a href="index.php?a=112&id=3&p=3">Add Subscriber</a>
        </div><div id="editSubscriberBlock">
        <form id="addSubscriberForm" action="index.php?a=112&id=3&p=8&u=94" method="post">
        <fieldset>
        </br>
        email: <input type="text" name="emailAddr" id="emailAddr" value=>

        name: <input type="text" size="40" name="name" id="name" value=Ruby Glaude>

        address1: <input type="text" name="address1" id="address1" value=4435 North Pershing>

        address2: <input type="text" name="address2" id="address1" value=>

        city: <input type="text" name="city" id="city" value=Arlington>

        state: <input type="text" name="state" id="state" value=VA>

        zip: <input type="text" name="zip" id="zip" value=22203>

        country: <input type="text" name="country" id="country" value=>

        phone: <input type="text" name="phone" id="phone" value=>

        fax: <input type="text" name="fax" id="fax" value=>




        <input type="submit" name="editSubscriber" id="editSubscriber" value="Save Changes" />
        </fieldset>
        </form>
        </div>
          • 4966
          • 143 Posts
          This is the code for the form. As long as I don’t do the - value=’.row[fieldname].’ the value is displayed correctly.

          $sql = "SELECT `id`, `email`, `yourName`, `address1`, `address2`, `city`, `state`, `zip`, `country`, `phone`, `fax`
          FROM ".$prefix."subscribers
          WHERE id = ".$subid;
          $result = $modx->db->query($sql);
          $row = $modx->db->getRow($result);
          $name = $row[’yourName’];

          $display_block .= ’
          <form id="addSubscriberForm" action="index.php?a=112&id=’.$modId.’&p=8&u=’.$subid.’" method="post">
          <fieldset>
          </br>
          <td>’.$name.’</td>
          email: <input type="text" name="emailAddr" id="emailAddr"value=’.$row[’email’].’>

          name: <input type="text" name="name" id="name" value=’. $name .’>

          address1: <input type="text" name="address1" id="address1" value=’.$row[’address1’].’>

          address2: <input type="text" name="address2" id="address1" value=’.$row[’address2’].’>

          city: <input type="text" name="city" id="city" value=’.$row[’city’].’>

          state: <input type="text" name="state" id="state" value=’.$row[’state’].’>

          zip: <input type="text" name="zip" id="zip" value=’.$row[’zip’].’>

          country: <input type="text" name="country" id="country" value=’.$row[’country’].’>

          phone: <input type="text" name="phone" id="phone" value=’.$row[’phone’].’>

          fax: <input type="text" name="fax" id="fax" value=’.$row[’fax’].’>

          <input type="submit" name="editSubscriber" id="editSubscriber" value="Save Changes" />
          </fieldset>
            • 16278
            • 928 Posts
            You need to ensure the values are enclosed in double quotes. So the code will read
            value="'. $name .'"><br>
            etc.
            smiley KP
              • 4966
              • 143 Posts
              Thanks that was it. I feel stupid now. It’s always the small things.