without using hidden variable how to submit the disabled textbox value.

HI,

In my web application i have 10 disabled textbox and it have some value,  I need to submit the textbox value to server side.

For this i need to create a 10 hidden variable to submit the value.

without using hidden variable how to submit the disabled textbox value.

how to solve the problem, if any right way is there?

For example:
    // this is my code in JSP
    <form name="consultantFrm">
   
    <input disabled type="text" name="mailUIAddressEmpSt1" maxlength="256" size="30" class="controlStyle" value="Gandhi street" tabindex="1">
    <input type=hidden name=mailAddressEmpSt1 value="">
   
    </form>
   
    <script>
    document.consultantFrm.mailAddressEmpSt1.value = document.consultantFrm.mailUIAddressEmpSt1.value;
    document.consultantFrm.submit();
    </script>
LVL 1
ZoniacAsked:
Who is Participating?
 
Sathish David Kumar NArchitectCommented:
<input type='text' readonly class='disableColor'..... >
0
 
Sathish David Kumar NArchitectCommented:
use read only mode of text box u cant edit so u can get the value easly
0
 
Sathish David Kumar NArchitectCommented:
if ur using css
the u write some class there for changing the color
 
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ZoniacAuthor Commented:
without using read only any other way  is there?
0
 
Sathish David Kumar NArchitectCommented:
is that any pblm using read with CSS ?
0
 
ZoniacAuthor Commented:
NO, But using disabled means, it is only one step . so that.....

0
 
Gurvinder Pal SinghCommented:
just enable the textbox before submitting, call this function before submitting

function enableField()
{
document.form1.mailUIAddressEmpSt1.disabled=false;
}

0
 
ZoniacAuthor Commented:
OK Thanks, I will accept the solution.
0
 
Sathish David Kumar NArchitectCommented:
for accept u will click accept not delete button
0
 
ZoniacAuthor Commented:
I accepted
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.