CodeIgniter Forums
input type button and onClick little problem - 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: input type button and onClick little problem (/showthread.php?tid=47101)



input type button and onClick little problem - El Forum - 11-26-2011

[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 '




input type button and onClick little problem - El Forum - 06-29-2012

[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