Welcome Guest, Not a member yet? Register   Sign In
Can someone help about form_dropdown() and onChange() in CodeIgniter
#2

[eluser]boltsabre[/eluser]
Try escaping your second double quotes " like this:

Code:
$js = 'onChange="alert(\\\\"Hello World\");"';
//Okay, im getting 2 backslashes before Hello, due to the escaping mechanism of this chat
// it should only be one backslash

Without escaping it you are basically telling it that it ends here:
Code:
onChange="alert("

That MAY fix your problem, I'm at work and don't have an installation of CI here to test it on.

Also, did you get any JS errors? Or other errors?
I use firefox for production as I like it's range of developer tools (plugins), use this one (see link below) to easily see JS errors. click on the cross to see what the error is.

Once you have it installed the very top right hand corner it's tool bar has 3 ticks or crosses (or a combination, but always 3), the very right one is for JS... if you have a tick you have no obviously JS code errors, but if you get a cross then yep, something's wrong.

Obviously you don't have to use FF or it's extensions, but it's my preference. Another great one if Firebug if you're not already using it (you can google that link yourself if you want it).

https://addons.mozilla.org/en-US/firefox...developer/

Good luck with it.


Messages In This Thread
Can someone help about form_dropdown() and onChange() in CodeIgniter - by El Forum - 11-19-2012, 03:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB