Welcome Guest, Not a member yet? Register   Sign In
Javascript in form_open()
#1

[eluser]Sceok[/eluser]
Hi everybody,

I've read many things but I haven't read a thing so far about the possibility of putting some Javascript in the opener tag of a form using the method "form_open()" from the Form Helper.

Just to show you why I'm asking this, there are cases when you may need to write that part in the form opener tag as a last attribute :

Code:
onsubmit="return(jsFunction())"
(didn't write the whole line, otherwise, it keeps on removing that part between code tags from the line when he displays it)

And in order to make sure my website stays portable, I'd preferred using the method from the Form Helper.

Anyone has information on it ? Or a solution ?

Thanks.
#2

[eluser]CroNiX[/eluser]
Look at the "Adding Attributes" section for form_open(), where you can add any extra key/value pairs:
http://ellislab.com/codeigniter/user-gui...elper.html
#3

[eluser]Sceok[/eluser]
Yeah thanks !!!
I had already tried this but I probably made a mistake while writing.
I tried again after reading your comment and yeah it works, probably my mistake.

Thank you for making me try that thing again ^^




Theme © iAndrew 2016 - Forum software by © MyBB