Welcome Guest, Not a member yet? Register   Sign In
input type button and onClick little problem
#1

[eluser]Krystian[/eluser]
Hi,

I need to create a form button with onClick

I`m trying like this but I`ve got some problems with apostrophes
Code:
$property_type_edit = array(
                 'id' => 'btn_orange',
                 'content' => 'Edit',
                  'onClick="document.location.href' =>  base_url() . 'controller/method'
                );
          
echo form_button($property_type_edit);

but this produces me

&lt;button name="" type="button" id="btn_orange" onClick="document.location.href="http://www.myapp.com/controller/method" >Edit</button>

and it is not working because I need to put whole http ... in single '

#2

[eluser]Maverick7[/eluser]
Is there truly no way to do this? that's logical,

I am looking for same thing, I have div and need anchor to work OnClick from div...

...and target? is that not working either in CI ?

just curious, I'm evaluating if CI would be a good way to go with application update I need to work on soon... Smile

Thanks & Cheers




Theme © iAndrew 2016 - Forum software by © MyBB