GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Jul-2003, 23:42
skyloon skyloon is offline
Junior Member
 
Join Date: Jun 2003
Posts: 53
skyloon is an unknown quantity at this point

value in text box


how can i show the value in the input text box when i click edit from the previous form? so i can edit the value. thanx a lot.
  #2  
Old 11-Jul-2003, 02:07
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Pretty simple, you just slot the values back into the form, like so:

<input type="text" name="data" value="$_POST['data']">

or something like that. The value attribute fills in the text box with a default value. Also for radio buttons and checkboxes to be selected by default, the syntax is:

<input type="radio" name="male" checked="checked">

Garth Farley
  #3  
Old 13-Jul-2003, 09:20
skyloon skyloon is offline
Junior Member
 
Join Date: Jun 2003
Posts: 53
skyloon is an unknown quantity at this point

menu??


the problem is the menu can't display the value when I click the edit button from the previous form.

I know the the text field is <value="<? echo $name ?>"> but how about the menu? <select name="State" value="<? echo $state ?>"> ??????
  #4  
Old 13-Jul-2003, 09:37
samtediou samtediou is offline
New Member
 
Join Date: Jul 2003
Posts: 18
samtediou is an unknown quantity at this point
Skyloon,

How is your site set up? Is your menu part of the same page as the form with the edit button (or an included script)? Anyway, if you submit the form to the same page again (<form action="<?php echo $PHP_SELF; ?>" method="post">) upon clicking your Edit button, then to read and output the submitted values you could use the following format that I've been using:

<select name="State" value="<? echo "$_POST['state']"; ?>">

Let me know if it works,

samtediou
  #5  
Old 13-Jul-2003, 10:15
skyloon skyloon is offline
Junior Member
 
Join Date: Jun 2003
Posts: 53
skyloon is an unknown quantity at this point
i click the submit button from the previous form, not from the same form
  #6  
Old 14-Jul-2003, 02:48
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Is it specifically the Select dropdown-y form element you are trying to have set?

Here's how to place a default:
Code:
<select name="dropdown"> <option value="option1">Option A</option> <option>Option B</option> <option selected="selected">Preset value</option> </select>

To have your PHP script be able to set a preset value, you'd have to put an if statement into each option. Like :

PHP Code:

<option value="option1" 
<? if( $_GET['dropdown']=="option1") print 'selected="selected" '; ?> > 


Note, if it is a multiple select, $_GET['dropdown'] will be an array! So you'll have to check each element in the array against the options in the SELECT.

GF
  #7  
Old 14-Jul-2003, 03:06
skyloon skyloon is offline
Junior Member
 
Join Date: Jun 2003
Posts: 53
skyloon is an unknown quantity at this point
thank you
 
 

Recent GIDBlogHalfway done! by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CD Burner Help - Power Calibration Error.... JonBoy420 Computer Hardware Forum 110 05-Feb-2008 18:34
CD Buring Failed skanth2000 Computer Hardware Forum 1 15-Nov-2003 03:52
text field problm zuzupus Web Design Forum 3 04-Sep-2003 05:18
Placing Flash/Images/Grapics inside TEXT with DHTML CSS Style Filteres 000 Web Design Forum 1 24-May-2003 11:25
Scrolling Text Ads - Free advertising on other peoples sites jrobbio Advertising & Affiliates Forum 0 19-Feb-2003 00:00

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:58.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.