Page 1 of 1

Put a fixed text on an input text field

Posted: Sun Oct 27, 2013 7:45 pm
by Gagi
Hi guys , i need someone to explain me how to put fixed text in one label for input text. There is code of field for input

Code: Select all

<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.o...ulv0r/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.

Re: Put a fixed text on an input text field

Posted: Sun Oct 27, 2013 9:02 pm
by requinix
Placeholder text?

Code: Select all

<input type="text" ... placeholder="server.minecraft.rs" />

Re: Put a fixed text on an input text field

Posted: Mon Oct 28, 2013 7:06 pm
by Gagi
No,no i dont need that.
I need *fixed text in that field, so users do not need to write always 'server.minecraf.rs' there, beacuse that is always the same. Or in other case to they cant even to edit that field with that text, just to see what is writed in there as automatic login information(server.minecraft.rs).

In case with placeholder they need to write 'server.minecraf.rs' because they cant login without that (and 2 more informations), that is why i cant use that. I need to always have 'server.minecraft.rs' in that field as automaticly writed information, so users do not need to write that.

Again, sorry for bad english, i hope to u can understand me.

Re: Put a fixed text on an input text field

Posted: Mon Oct 28, 2013 7:14 pm
by requinix
Put the value in the textbox, mark it readonly so users see they can't edit it,

Code: Select all

<input type="text" ... value="server.minecraft.rs" readonly />
then hardcode that value into your application instead of looking to $_GET/POST.