• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
forms have no input boxes

#1
[eluser]wesleychristelis[/eluser]
i have the following basic piece of code

<?= form_open()?>
<?=form_open()?>

<?=isset($message) ? $message : ''?>

<p>
Username: &lt;?=form_input('username', set_value('username'))?&gt;
</p>
<p>
Password: &lt;?=form_password('password')?&gt;
</p>
&lt;?=form_submit('submit', 'Login')?&gt;
&lt;?=form_close()?&gt;

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

#2
[eluser]InsiteFX[/eluser]
You do not have php short tags turned on:
Code:
&lt;?=
// change all php tags to
&lt;?php echo form_open(); ?&gt;

#3
[eluser]wesleychristelis[/eluser]
hi apologies

&lt;?php form_open()?&gt;

&lt;?php isset($message) ? $message : ''?&gt;

<p>
Username: &lt;?php form_input('username', set_value('username'))?&gt;
</p>
<p>
Password: &lt;?php form_password('password')?&gt;
</p>
&lt;?php form_submit('submit', 'Login')?&gt;
&lt;?php form_close()?&gt;

for the above it was omitting the "echo" ...see below ... fixed this .

&lt;?php echo form_open()?&gt;

&lt;?php isset($message) ? $message : ''?&gt;

<p>
Username: &lt;?php echo form_input('username', set_value('username'))?&gt;
</p>
<p>
Password: &lt;?php echo form_password('password')?&gt;
</p>
&lt;?php echo form_submit('submit', 'Login')?&gt;
&lt;?php echo form_close()?&gt;

#4
[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 (Wink which may or may not be the problem. I have inserted them in the snippet below.

Code:
&lt;?php echo form_open(); ?&gt;

&lt;?php isset($message) ? $message : ‘’; ?&gt;


  Username: &lt;?php echo form_input(‘username’, set_value(‘username’)); ?&gt;


  Password: &lt;?php echo form_password(‘password’); ?&gt;

&lt;?php echo form_submit(‘submit’, ‘Login’); ?&gt;
&lt;?php echo form_close(); ?&gt;

#5
[eluser]CroNiX[/eluser]
Did you load the form helper?

#6
[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.

#7
[eluser]TWP Marketing[/eluser]
@CroNIX, Thanks for the tip. I never leave them out, so it has never come up before.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.