Jump to content

unsure how to even explain this, about a form


Rifts

Recommended Posts

OK I will try my best to explain what I'm trying to do.

 

On my site there is a form. after a member submits the form I want the form with their answers to show up in their member/profile page.. I want the form to look the same except with their answers filled in and I want it like grayed out do you can not re-edit it.

 

Does that make sense?

 

Thanks

you disable a text box like so

<input type="text" disabled="disabled" />

 

you can set the value of a text box like so

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

 

if you submit the form to the page where you want to show the disabled form, all you have to do is set the value to the corresponding post variables. if you submit them to a database, then you will have to pull the values from the database, and fill out the form

well whatever data you want, just use a query. if I wanted to get the columns col1, col2, and col3 from the row where the id was 5, i would do

$query = "SELECT col1, col2, col3 from table WHERE id=5";
$sql = mysql_query($query);

$row = mysql_fetch_assoc($sql);
//now I can access the values like so
$row['col1'];//column 1
$row['col2'];//col2
//etc.

Alright thanks to you I semi figured it out haha I can do the text boxes but I'm unsure of how to "re-check" the check boxes I have... in my database they are stored as either a 0 if unchecked or a 1 if checked so how do I recheck them in the copy of the form?

 

thanks

Archived

This topic is now archived and is closed to further replies.

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