Jump to content

Recommended Posts

Hi guys , i need someone to explain me how to put fixed text in one label for input text. There is code of label for input

<div>
											<label><?php echo __("FTP server"); ?></label>
<?php											if ($ftpserver["inputType"] == "text") { ?>
												<input type="text" name="ftpserver" value="<?php echo $ftpserver["list"][1]; ?>" class="form-poshytip" title="<?php echo __("Example"); ?>: server.minecraft.rs" />
<?php											} elseif ($ftpserver["inputType"] == "select") { ?>
												<select name="ftpserver">
<?php												for ($i=1; $i<=sizeof($ftpserver["list"]); $i=$i+1) { ?>
													<option value="<?php echo $ftpserver["list"][$i]; ?>" <?php echo $ftpserver["list"][$i]["selected"]; ?>><?php echo $ftpserver["list"][$i]; ?></option>
<?php												} // end for ?>
												</select>
<?php											} elseif ($ftpserver["inputType"] == "hidden") { ?>
												<input type="hidden" name="ftpserver" value="<?php echo $ftpserver["list"][1]; ?>" />
												<b><?php echo $ftpserver["list"][1]; ?></b>
<?php											} ?>
										</div>

I have this http://s23.postimg.org/c7soulv0r/image.png but i need to always have this 'fixed' text in that label http://s22.postimg.org/eniz4fr3l/image.png

And i cant figure how to do that in this code situation ...

Sorry for my bad english and thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/283345-put-a-fixed-text-on-an-input-text/
Share on other sites

That is not of PHP. Is HTML5.

Is the attributte "placeholder" of HTML5.

 

Example:

<input name="first_name" placeholder="Your first name..." type="text">

 

You can see an example here: http://davidwalsh.name/html5-placeholder

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.