Jump to content


PHP method to input text into an input box

  • Please log in to reply
1 reply to this topic

#1 Perad

  • Members
  • PipPipPip
  • Advanced Member
  • 287 posts

Posted 13 October 2006 - 10:37 AM

I know you can use value. But value doesn't show up on firefox. It also removes itself when the user selects the input box.

I want to call data from the database and display it in an input box so a user can edit and change it. Does anyone know how i can do this?

#2 AndyB

  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 13 October 2006 - 10:57 AM

Retrieve the specific data from your database and display it using the appropriate form type as shown below.  It will show up with any browser.

<input type="text" name="something" value="<?php echo $something;?>"/>

<textarea rows="5" cols="30" name="something"><?php echo $something;?></textarea>

After the user changes the displayed data and submits the form, read the new value of 'something' and UPDATE the appropriate row of your database table.

Without seeing any of your code, it's difficult to be more specific about solving your problem.
Legend has it that reading the manual never killed anyone.
My site

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users