Welcome Guest, Not a member yet? Register   Sign In
Input with disabled
#1

[eluser]ervinter[/eluser]
I got input as following

Code:
<select style="width: 40px;" id="cbo_cwb_01">
<option value="0">0</option>
<option selected="selected" value="1">1</option>
</select>

When I trying to get the value by code below

Code:
$this->input->post('cbo_cwb_01');

If seem like cannot get the value when is has disabled=""

Anybody can assist me on how to get the value with disabled on input?
#2

[eluser]bretticus[/eluser]
[quote author="ervinter" date="1252923125"]
If seem like cannot get the value when is has disabled=""

Anybody can assist me on how to get the value with disabled on input?[/quote]

Just curious why you need the value for a disabled form input. However, I think the browser doesn't pass it through anyway. If you really need it, perhaps you can use javascript to get the value and post it via ajax.
#3

[eluser]umefarooq[/eluser]
if you want to get value from you input make it readonly or make it hidden to get value from it. readonly will be the good option

Code:
&lt;INPUT type="text" NAME="realname" VALUE="Hi There" READONLY&gt;
#4

[eluser]brianw1975[/eluser]
Edit: OH, OH, OH....

I think I missed your point (I'm still a bit groggy). I'm going to investigate this a bit, feel free to take the following as a public service announcement lol.



Depending on the form and its usage you should avoid using html/javascript to protect any kind of field. with the advent of things like firebug, webdeveloper toolbar, etc, simply setting something as READONLY or disabled is not secure and can be easily edited by the user in FireFox and those form objects made to work.

You should be wary of hidden fields as well that simply pass data that you should be setting server side.

But like I said, it depends on the purpose of the form.
#5

[eluser]brianw1975[/eluser]
[quote author="bretticus" date="1252925181"][quote author="ervinter" date="1252923125"]
If seem like cannot get the value when is has disabled=""

Anybody can assist me on how to get the value with disabled on input?[/quote]

Just curious why you need the value for a disabled form input. However, I think the browser doesn't pass it through anyway. If you really need it, perhaps you can use javascript to get the value and post it via ajax.[/quote]

But notice that he says:
Quote:disabled=""
not:
Quote:disabled="disabled"

different doctypes, different browsers, different results.

check http://www.w3schools.com/Xhtml/xhtml_syntax.asp

I think we need to ask: ervinter: what doctype are you using? and what browser(s) are you testing with?

EDIT: Finally, does the html page pass Validation?




Theme © iAndrew 2016 - Forum software by © MyBB