Welcome Guest, Not a member yet? Register   Sign In
Problem when using $ character as name of input tag
#1

[eluser]zenixgrace[/eluser]
Hi All,

I have problem when I want to use $ character as name of input tag.
When I remove the $, it's work well.

The error messages is "Disallowed Key Characters."

is the CI cannot accept $ character as name of input tag?
ex : <input type='text' name='NameBlock$ddlDOB' />

Best Regards,
zenixgrace
#2

[eluser]zenixgrace[/eluser]
Hi All,

Problem Solved.

I fixed that out by update the core CI regex in Input.php.
In function _clean_input_keys change the regex /^[a-z0-9:_\/-]+$/i with /^[a-z0-9:_\/-\/$]+$/i
But I don't know it's a best way or not.

May be someone have a good solution for this case.

Best Regards,
zenixgrace
#3

[eluser]kanjimaster[/eluser]
What you're trying to do contravenes W3 standards for HTML which state that:
Quote:ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
There's therefore no guarantee that all browsers will use your field names as you expect. So the best solution would be change to a compliant naming convention, rather than hacking Codeigniter code to support one that may fail.
#4

[eluser]zenixgrace[/eluser]
[quote author="kanjimaster" date="1337840478"]What you're trying to do contravenes W3 standards for HTML which state that:
Quote:ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
There's therefore no guarantee that all browsers will use your field names as you expect. So the best solution would be change to a compliant naming convention, rather than hacking Codeigniter code to support one that may fail.[/quote]


Thanks for the information.
But I still need this because I grab it from the other site and show in my site. After that, I send it again to that site.
The site that I scrapping the content is using ASP.NET language.
#5

[eluser]CroNiX[/eluser]
You shouldn't ever modify core files like that. There is a setting specifically to do what you are trying to do in the /application/config/config.php file, permitted_uri_chars, and that's where you should add your $. If you don't, then whenever you upgrade codeigniter you will have to remember to go back and add in all of your changes or it will break the application and probably take you a long time to figure out why.
#6

[eluser]zenixgrace[/eluser]
[quote author="CroNiX" date="1337878281"]You shouldn't ever modify core files like that. There is a setting specifically to do what you are trying to do in the /application/config/config.php file, permitted_uri_chars, and that's where you should add your $. If you don't, then whenever you upgrade codeigniter you will have to remember to go back and add in all of your changes or it will break the application and probably take you a long time to figure out why.[/quote]

Before I modify the core file.
I try to modify permitted_uri_chars configuration in config.php. But I'm got it not work.
I think in permitted_uri_chars configuration, it's just only effects for URL.
But in my case it's not URL. It's a Name of input tag / Name of POST Data.

I Change my mind to not hack the core input class. But I'm extend _clean_input_keys codeigniter input class.

I agree with you if I want to upgrade my codeigniter version if there are have a new versions.
I will get the problem to remember which one I have modified.

Thanks for your direction bro.
It's helpfull.




Theme © iAndrew 2016 - Forum software by © MyBB