Welcome Guest, Not a member yet? Register   Sign In
Replace form_submit with button
#1

[eluser]codejack[/eluser]
Hi, gents.

I'd like to replace the submit button in my forms with a simple a href button.

Code:
echo form_open('login', $attributes); ?>

<p>
&lt;?php echo form_label('Username', 'username'); ?&gt;
&lt;?php echo form_input($username_nice); ?&gt;
</p>

<p>
&lt;?php echo form_label('Password', 'password'); ?&gt;
&lt;?php echo form_password($password_nice); ?&gt;
</p>

<p>
&lt;?php echo form_submit('submit', 'Login'); ?&gt;
</p>

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

So I need to replace the form_submit function with something like this:

Code:
<p>
<a href="#" class="medium nice radius button">Open sesame!</a>
</p>

Is this possible? How would I go about doing this?
#2

[eluser]CroNiX[/eluser]
Yes, but it would require javascript to submit your form. An anchor isn't a form element...

Why do you want to do this? If it's just to change the style, why not just style the submit button?

Code:
&lt;?php echo form_submit('submit', 'Login', 'class="medium nice radius button"'); ?&gt;




Theme © iAndrew 2016 - Forum software by © MyBB