Jump to content

Put a fixed text on an input text


Gagi

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.