Page 1 of 1

Disabled fields and passing information

Posted: Wed Feb 11, 2004 12:21 am
by iampeter
Ok heres my scenario:
On one page a user enters a name to search my database by and the results of which as well as the name typed in are displayed on the second page for the user to change accordingly.

Now on this second page i want to disable the text box containing the name typed in so that it cannot be edited because only the details associated with that name need to be edited.

I have tried to disable it by both making it simple a PRINT statement as well as changing the text TYPE to DISABLED TYPE='text' however in both situations the variable that stores the name becomes empty so when the user makes his appropriate changes and clicks 'continue' which then takes him to the confirmation page the name itself is not outputted, while all the changed information is.

So basically what im asking is how can i disable a text field on one page but have the information stored in it still pass onto the next one?

Posted: Wed Feb 11, 2004 12:47 am
by Illusionist
are you sure your passing the name to the other page?? using post or get? and then on the second page recieving it by soemthing like

Code: Select all

$name = $_GET['name'];
//or
$name = $_POST['name'];
//or
$name = $_REQUEST['name'];

Re: Disabled fields and passing information

Posted: Wed Feb 11, 2004 6:14 am
by valaridz
iampeter wrote: So basically what im asking is how can i disable a text field on one page but have the information stored in it still pass onto the next one?
You can use javascript.

Posted: Wed Feb 11, 2004 6:19 am
by JayBird
i think i had the same problem with disabled fields not passing their values.

What you could do, is display the name in a disabled text field and store the value in a hidden field.

Mark

Posted: Wed Feb 11, 2004 6:21 am
by malcolmboston
bech is right........

.......thats how i do it and it works