• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Applying a style sheet class to a Form

#1
[eluser]MightyBishop[/eluser]
Hi all,

Still very new to all this, but loving it! Bit confused about applying style sheets to the form_open() command.

Say I want to end up with something like this in my page:

Code:
<form class="form-style">

How do I go about applying that class to the form_open() command?

I read somewhere else about adding on a style as an extra parameter to something, but for the life of me I can't remember - old age creeping in!

Thanks for any help,

Best regards

JB

#2
[eluser]TWP Marketing[/eluser]
From the User Guide:
http://ellislab.com/codeigniter/user-gui...elper.html

Quote:Adding Attributes

Attributes can be added by passing an associative array to the second parameter, like this:

Code:
$attributes = array('class' => 'email', 'id' => 'myform');

echo form_open('email/send', $attributes);

The above example would create a form similar to this:
Code:
<form method="post" accept-charset="utf-8" action="http:/example.com/index.php/email/send"  class="email"  id="myform" />

#3
[eluser]MightyBishop[/eluser]
Aha!

RTM comes to mind. Thank you very much for this.

Best regards

JB


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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