forms have no input boxes - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: forms have no input boxes (/showthread.php?tid=53000) |
forms have no input boxes - El Forum - 07-06-2012 [eluser]wesleychristelis[/eluser] i have the following basic piece of code <?= form_open()?> <?=form_open()?> <?=isset($message) ? $message : ''?> <p> Username: <?=form_input('username', set_value('username'))?> </p> <p> Password: <?=form_password('password')?> </p> <?=form_submit('submit', 'Login')?> <?=form_close()?> when viewing it in the browser i only see the following (see screen shot ) I have no input boxes... not sure what is wrong . the titles i.e. username ad password show . but the input boxes next to them dont , i have tried firefox , chrome, safari... no luck . what am i missing CI 2.1.2 forms have no input boxes - El Forum - 07-06-2012 [eluser]InsiteFX[/eluser] You do not have php short tags turned on: Code: <?= forms have no input boxes - El Forum - 07-09-2012 [eluser]wesleychristelis[/eluser] hi apologies <?php form_open()?> <?php isset($message) ? $message : ''?> <p> Username: <?php form_input('username', set_value('username'))?> </p> <p> Password: <?php form_password('password')?> </p> <?php form_submit('submit', 'Login')?> <?php form_close()?> for the above it was omitting the "echo" ...see below ... fixed this . <?php echo form_open()?> <?php isset($message) ? $message : ''?> <p> Username: <?php echo form_input('username', set_value('username'))?> </p> <p> Password: <?php echo form_password('password')?> </p> <?php echo form_submit('submit', 'Login')?> <?php echo form_close()?> forms have no input boxes - El Forum - 07-09-2012 [eluser]TWP Marketing[/eluser] First, please enclose your code in the [ code][ /code] tags so we can read your code easier. Next, your php statements do not appear to have the closing semicolon ( which may or may not be the problem. I have inserted them in the snippet below. Code: <?php echo form_open(); ?> forms have no input boxes - El Forum - 07-09-2012 [eluser]CroNiX[/eluser] Did you load the form helper? forms have no input boxes - El Forum - 07-09-2012 [eluser]CroNiX[/eluser] @TWP Marketing - technically you only need semicolons to separate multiple statements within a single php code block, although it's generally a best-practice to use them at the end of each statement. Never worked for a professional firm where that was acceptable. forms have no input boxes - El Forum - 07-09-2012 [eluser]TWP Marketing[/eluser] @CroNiX, Thanks for the tip. I never leave them out, so it has never come up before. |