hidrau
asked on
How can I set readonly for all my input that has a prefix name "f_tab_4"?
Hello guys
I have 30 inputs, 10 inputs has this prefix name
f_tab_4_??????
Is there any way to set all input with prefix "f_tab_4_" to readonly and a attibute name upd="0" ?
thanks
I have 30 inputs, 10 inputs has this prefix name
f_tab_4_??????
Is there any way to set all input with prefix "f_tab_4_" to readonly and a attibute name upd="0" ?
<input type="text" id="f_tab_4_frete" upd="0" />
<input type="text" id="f_tab_4_clie" upd="0" />
<input type="text" id="f_tab_4_cod" upd="0" />
<input type="text" id="f_tab_4_desc" upd="0" />
<input type="text" id="f_tab_4_prod" upd="0" />
<input type="text" id="f_tab_4_uf" upd="0" />
<input type="text" id="f_tab_4_raz" upd="0" />
<input type="text" id="f_tab_4_ema" upd="1" />
<input type="text" id="f_tab_4_was" upd="1" />
<input type="text" id="f_tab_4_tipo" upd="1" />
thanks
ASKER
hello zappafan2k2
I tried and the code put readonly in all inputs and not only in inputs with upd="0".
I think I wasn't clearly with my needs.
The function must set all inputs to readonly only when the input has the tag upd="0" and not to add the tag upd="0". Did you get it?
I tried and the code put readonly in all inputs and not only in inputs with upd="0".
I think I wasn't clearly with my needs.
The function must set all inputs to readonly only when the input has the tag upd="0" and not to add the tag upd="0". Did you get it?
Sorry.
$('[id^="f_tab_4_"]').find('[upd="0"]').attr('readonly','readonly');
ASKER
I tried but it didn't work :(
ASKER
I think the problem is with find() function. If I take off it, it worked fine but set all input readonly
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yes friend. Now it worked fine.
Thanks very much for your helo
Thanks very much for your helo
ASKER
thanks
Open in new window