Dear All,
This website has taught me lot of things since i was an engineering student. Now again i am back with a new question......


I need to read the contents of the jsp page that is using JSF framework through the Javascript.

Any help for starting the thing will be of great help.

Thanks and regards,
Himadri Sikhar Khargharia
or mdew_47

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

    </head>
    <body id="himadri">
        

            <h1>Hello World!</h1>
            
<form id="help" name="help" method="post" action="/Himadri-war/faces/WEB-INF/See.jsp" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="help" value="help" />
<table>
<tbody>
<tr>
<td class="rightalign"><label>
Userid: </label></td>
<td class="leftalign"><span id="help:userid">88</span></td>

</tr>
<tr>
<td class="rightalign"><label>
FirstName: </label></td>
<td class="leftalign"><span id="help:firstname">tght</span></td>
</tr>
<tr>
<td class="rightalign"><label>
Lastname: </label></td>
<td class="leftalign">ghg</td>
</tr>
<tr>
<td class="rightalign"><label>

Gender: </label></td>
<td class="leftalign">gr</td>
</tr>
<tr>
<td class="rightalign"><label>
Age: </label></td>
<td class="leftalign">43</td>
</tr>
<tr>
<td class="rightalign"><label>
Details: </label></td>
<td class="leftalign"><span id="help:Details"></span></td>

</tr>
</tbody>
</table>
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="2606324558782240815:-4303962549239945749" autocomplete="off" />
</form>
        </body>
</html>

I need to read a page like this... I am using:

function Apply(){
alert('hello first1');
var frm = document.getElementById("help:firstname");
alert(frm);
alert('hello second2');
}

But in this case alert(frm) is showing null.... Please help me to find out the proble, by using innerHTML...even the third alert statement is not executed.... I need to get the value of the element by Id "help:firstname"...

Please help..thanks and regards
himadri

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.