Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-08-17
10
Medium Priority
?
706 Views
Last Modified: 2012-05-10
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>
0
Comment
Question by:Zoniac
  • 5
  • 4
10 Comments
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 33452345
use read only mode of text box u cant edit so u can get the value easly
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 33452359
if ur using css
the u write some class there for changing the color
 
0
 
LVL 1

Author Comment

by:Zoniac
ID: 33452382
without using read only any other way  is there?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 33452393
is that any pblm using read with CSS ?
0
 
LVL 1

Author Comment

by:Zoniac
ID: 33452407
NO, But using disabled means, it is only one step . so that.....

0
 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 750 total points
ID: 33452451
<input type='text' readonly class='disableColor'..... >
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 33452494
just enable the textbox before submitting, call this function before submitting

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

0
 
LVL 1

Author Comment

by:Zoniac
ID: 33452526
OK Thanks, I will accept the solution.
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 33452550
for accept u will click accept not delete button
0
 
LVL 1

Author Closing Comment

by:Zoniac
ID: 33452767
I accepted
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
Do online retailers and e-commerce sites even need to bother with the season? Is it lucrative to update and prepare your site for Black Friday and Cyber Monday shoppers? We'll find out now.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Screencast - Getting to Know the Pipeline
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question