Jump to content

PHP method to input text into an input box


Perad

Recommended Posts

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?
Link to comment
Share on other sites

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.

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

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

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.