Jump to content

php form field default value


toonz

Recommended Posts

Good morning. I have a quick question on how to create and display a default form field value in an html document I have. The current line looks like this

 

<input class="Input" value="{opt1}" name="{opt1_Name}" style="WIDTH: 336px" size="50" >

 

 

What is the tag I need to add in order to create a default value that will display in the field, but can be written over if I need to change it to something else? Your help is greatly appreciated. Thanks

Link to comment
Share on other sites

None of that looks like php to me, maybe some template engine?

 

Anyway, in php it would look something like....

 

<input class="Input" value="<?php echo isset($_POST['fld']) ? $_POST['fld'] : 'default value'; ?>" name="{opt1_Name}" style="WIDTH: 336px" size="50" >

Link to comment
Share on other sites

well, it would most likely be html than, since its a form that is pulling information from a .php file. the 'value' tag is actually the name of the field in the sql database, so I dont want to mess with that or it probably wont pull any information from the database. This was part of a script that was made for me awhile ago, and now I need to make some small changes which is where Im getting stuck. Thanks for your reply

Link to comment
Share on other sites

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.