"> Invisible form segment - Forums

Forums

Invisible form segment

MJudge 08 Mar, 2011
You helped me with a web-form a month or two ago that is used only by registered users at my website. The form is only available after they log-in and it’s set up to automatically fill in their username. That name field is not editable by the user, but it does return their username along with all other form data as the form is submitted. If possible I would like to remove the username input box and label from the form entirely (actually, make it invisible) since it still needs to return its value with the rest of the form data. Is there a way to allow username to be submitted without actually showing up on the form? The current HTML code is included below.
Thanks, Mike

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 125px;">Member Username</label>
<input class="cf_inputbox required" maxlength="80" size="15" title="Name may not be edited on this form" id="text_1" name="text_1" type="text" value="<?php $user = &JFactory::getUser();echo $user->username;?>" readonly='readonly' />
 </div>
GreyHead 09 Mar, 2011
Hi MJudge,

You can change type='text' to type='hidden' and remove any now unneeded <label> and <div> tags around the input.

Bob
MJudge 09 Mar, 2011
That worked great - Thank you!
This topic is locked and no more replies can be posted.