dinoslikeroar Posted September 12, 2016 Share Posted September 12, 2016 I am trying to figure out how to get the instructions to display next to the input box. Right now the text is displaying within the text box and is being cut off. The placeholder='$entry_instructions' is the information that needs to be moved to a <p> tag next to the input box. $attr_input = "<input type='text' id='attribute_$tracker_alert_attribute_id' name='attribute_$tracker_alert_attribute_id' ". "value='$value' placeholder='$entry_instructions' $trigger_on_change_html>"; } else { $attr_input = "<input type='text' name='attribute_$tracker_alert_attribute_id' placeholder='$entry_instructions' value='$value' size='10'>"; } Quote Link to comment https://forums.phpfreaks.com/topic/302161-tag-next-to-an-input-box/ Share on other sites More sharing options...
cyberRobot Posted September 12, 2016 Share Posted September 12, 2016 Instead of using the placeholder attribute, have you tried putting the instructions outside of the <input> tag? Maybe something like this: $attr_input = "<input type='text' id='attribute_$tracker_alert_attribute_id' name='attribute_$tracker_alert_attribute_id' value='$value' $trigger_on_change_html> $entry_instructions"; Quote Link to comment https://forums.phpfreaks.com/topic/302161-tag-next-to-an-input-box/#findComment-1537428 Share on other sites More sharing options...
Strider64 Posted September 12, 2016 Share Posted September 12, 2016 or just use label after the input statement and it perfectly HTML $attr_input .= '<label for="tracker">' . $entry_instructions . '</label>'; Quote Link to comment https://forums.phpfreaks.com/topic/302161-tag-next-to-an-input-box/#findComment-1537445 Share on other sites More sharing options...
cyberRobot Posted September 12, 2016 Share Posted September 12, 2016 or just use label after the input statement and it perfectly HTML $attr_input .= '<label for="tracker">' . $entry_instructions . '</label>'; Just be aware that the for attribute in the <label> tag needs to match the id attribute in the <input> tag. Otherwise, the <label> tag won't do anything. Or, if you want, the <label> tag can be wrapped around the <input> tag. Then the for and id attributes are not needed. More information can be found here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label Quote Link to comment https://forums.phpfreaks.com/topic/302161-tag-next-to-an-input-box/#findComment-1537447 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.