Jump to content

Archived

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

ReVeR

PHP and html edit

Recommended Posts

Hello.
I have a textbox, and i was wondering how i could fill it with default data?
What parameter do i need to set?
Thx

Share this post


Link to post
Share on other sites
[!--quoteo(post=356829:date=Mar 21 2006, 03:22 AM:name=ReVeR)--][div class=\'quotetop\']QUOTE(ReVeR @ Mar 21 2006, 03:22 AM) [snapback]356829[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hello.
I have a textbox, and i was wondering how i could fill it with default data?
What parameter do i need to set?
Thx
[/quote]

Depends on how you plan to set it. I think this code works well serverside assuming your textbox is called 'textbox':

[code]
<?php
$default_content = "Your default content";
if (isset($_POST['textbox']))
    $default_content = trim($_POST['textbox']);
?>
[/code]

for your texbox you only need

[code]
<input type="text" name="textbox" id="textbox" value="<?php echo $default_content;?>" />
[/code]

Share this post


Link to post
Share on other sites

×

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.