ShoeLace1291 Posted May 22, 2007 Share Posted May 22, 2007 How would I display a text input if a user checks a certain checkbox? This is my code: echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'DTD/xhtml1-transitional.dtd'> <html> <body> <table align='center' width='50%' cellspacing='1' cellpadding='1' border='0'> <tr> <td> <FIELDSET width='50%'> <LEGEND>Upload a File</LEGEND> <form action='upload.php' method='post' name='fileForm' enctype='multipart/form-data'> <div align='center'>Choose a File:</div> <table align='center' cellspacing='1' cellpadding='1' border='0'> <tr> <td><input name='upfile' type='file'></td> </tr><tr> <td><input type='checkbox' name='private' value='1'>Only allow me to see this image</td> </tr><tr> <td><input type='checkbox' name='portfolio' value='1'>Insert this image into my porftolio</td>"; </tr><tr> if($_POST['portfolio']){ echo "<td>Image Title</td> </tr><tr> <td><input type='text' name='title' size='30' value='My Image'></td> </tr><tr> <td>Description</td> </tr><tr> <td><input type='text' name='description' size='30' value='I hope you like my image!'></td> </tr><tr>"; } <td><input type='submit' name='submitBtn' value='Upload'></td></form> </tr> </table> </form></FIELDSET></td></tr></table> </body>"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.