Jump to content


Photo

PHP and html edit


  • Please log in to reply
1 reply to this topic

#1 ReVeR

ReVeR
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts

Posted 21 March 2006 - 02:22 AM

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

#2 azuka

azuka
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 21 March 2006 - 02:40 AM

[!--quoteo(post=356829:date=Mar 21 2006, 03:22 AM:name=ReVeR)--][div class=\'quotetop\']QUOTE(ReVeR @ Mar 21 2006, 03:22 AM) View Post[/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':

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

for your texbox you only need

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

Given enough eyeballs all bugs are shallow. My Website




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users