Solved

value not getting displayed from jsp

Posted on 2014-04-07
5
538 Views
Last Modified: 2014-04-30
Hi,
I am attaching two files for a page of a web application.
The payment.txt (payment.jsp file name changed for uploading reason) jsp is the file which gets rendered in the page.
And the other file is the one which i got by pressing ctrl+U (view source) in firefox.

The problem which i am encountring is at line :
                                                <input id="loggedInMobile" onkeypress="return isNumberKey(event)" mylabel="Mobile Number" validation="required|defaultInvalid|regTypeIsd[phone,10,loggedInMobileISD]" value="${user.userMobileNo}" class="PayConInput inputTxtBox disableinput" msginfo="* required,,* Mobile number should be 10 digit" type="text" maxlength="10" tabindex="144" readonly style="width:90px" />&nbsp;<a tabindex="143" id="editMobile" href="javascript:fReview.editMobile();">Edit</a>

This line ideally should display the mobile no. which is held in ${user.userMobileNo}

As can be seen in the source the mobile no. is getting passed in jsp at the line :
      <input type = "hidden" name = "user.userMobileNo" id = "userMobileNo" value ="9711070972"/>

      But still i randomly see occasions when the mobile no. is not displayed on the webpage.
      How could this be possible ?
      This specially happens when i open the same page again in other tab
source-wen-mobile-no.-not-coming.txt
payment.txt
0
Comment
Question by:Rohit Bajaj
5 Comments
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 39982906
in the view source code also mobile number is getting displayed.
check at what time below value is not getting dispalyed in this tag.

      <input id="loggedInMobile" onkeypress="return isNumberKey(event)" mylabel="Mobile Number" validation="required|defaultInvalid|regTypeIsd[phone,10,loggedInMobileISD]" value="9711070972" class="PayConInput inputTxtBox disableinput" msginfo="* required,,* Mobile number should be 10 digit" type="text" maxlength="10" tabindex="144" readonly style="width:90px" />&nbsp;<a tabindex="143" id="editMobile" href="javascript:fReview.editMobile();">Edit</a>
0
 

Author Comment

by:Rohit Bajaj
ID: 39982933
The above view source was an example when on ui the mobile no. 9711070972 didnt get displayed although it appeared in the view source
This is rare.. I am able to reproduce it very infrequently
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 39982948
until we see the code we cannot judge where the prooblem lies.
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 39991134
As per my understanding in your code . Its failed in your validation

<input id="loggedInMobile
onkeypress="return isNumberKey(event)" 
mylabel="Mobile Number" 
validation="required|defaultInvalid|regTypeIsd[phone,10,loggedInMobileISD]" 
value="${user.userMobileNo}"
 class="PayConInput inputTxtBox disableinput" msginfo="* required,,* Mobile number should be 10 digit"
        type="text" maxlength="10" tabindex="144" readonly style="width:90px" />&nbsp;
<a tabindex="143" id="editMobile" href="javascript:fReview.editMobile();">Edit</a>

Open in new window

0
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39998124
In the view source, while your <input> field definitely has the mobile number there, the enclosing <div> element has a style of "display: none". Is that the issue, that the entire input field is not there OR is the field there and you just don't have the value inside it?

I realise that there may be some CSS/Javascript/JQuery/etc that changes this style and makes it visible but with a brief search of the "source" I couldn't find it, and I can't really do any detailed debugging of ALL those lines of code to find it. What I am getting at, is that if you have some JQuery code somewhere perhaps that is making the <div> displayed again, then it may also be interfering with the field value.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

759 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now