I want field on popup from database

Recommended Answers

All 3 Replies

Post the code you have done so far and provide more details with regard to what you need help with.

<%

   String _empId = (String) request.getAttribute("EmployeeId"); 
   String _flagForPage = (String) request.getAttribute("FlagForPage");


   String redStarStr="*";
   if(_flagForPage!=null && _flagForPage.equals("2"))
   {
       redStarStr="";
   }//end by sanjeevani

   String str1="Edit";
    if(_flagForPage == null)
       _flagForPage = "0"; // means Page Opened for Add mode, if _flagForPage = 1 means Page opened for Edit mode.


    String _selEmpId = (String) request.getAttribute("SelEmpId");
    String _employeeName=(String) request.getAttribute("SelEmpName");

    String _CurrentDate = (String)request.getAttribute("CurrentDate");

    String _FlagForMessage = (String)request.getAttribute("FlagForMessage");

    String _cmd3 = (String)request.getParameter("command3");
    if(_cmd3 == null)
       _cmd3 = "0";
    String _checkMsgFlag = (String) request.getAttribute("checkMsgFlag");

    if(_selEmpId == null)
         _selEmpId = "0"; 


%>

<form name="frmAddPopUp" id="frmAddPopUp" action="AControlServlet" method="POST">

<table class="tbg1" width="100%" border="0" cellpadding="0" cellspacing="0">                 
  <tr><td width="17%" class="padding3" valign="top">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">

    <%   if(_flagForPage == "1" || _flagForPage == "2") { %>
           <tr><td height="4px"></td></tr>
           <tr><td>
           <div id="noPhotoDiv" name="noPhotoDiv" style="display:">
                    <table width="100%" class="T_Border" cellpadding="0" cellspacing="0" border="0" height="180px">
                        <tr><td width="100" height="100"><img src="jsp/image1.jsp?empid=<%=_selEmpId%>" width="215" height="150" > </td></tr>
                        <tr><td class="lebel2" height="10px""><center><%=_employeeName%></center></td></tr>    
                    </table>
            </div>
           </td></tr>
        <% } %>
      </table>
    </td>

           <input type="hidden" id="hselEmpId" value="<%=_selEmpId%>">
                             <!-- Begin code to use Photo imgage name -->
                                <select style="display:none" class="inputbox_250W" id="selEmpPhotoName" name="selEmpPhotoName"  onKeyDown="if(event.keyCode==13) event.keyCode=9;" value="0">
                                    <option value="0">- Select - </option>                                        
                                    <c:forEach var="dispPhotoNm" items="${AllEmployeeDetails}">
                                        <option value="${dispPhotoNm.fempId}" >${dispPhotoNm.fempPhotoNm}</option> 
                                    </c:forEach>
                                </select>

        <td width="83%" class="padding4">
        <!-- Begin Right Side Employee Personal Info Part  -->                         
        <table width="100%" class="T_Border" cellpadding="2" cellspacing="0" border="0">         
        <input type="hidden" id="hFlagForPage" value="<%=_flagForPage%>" >

        <!-- hidden to store 1/0 for javascript function setPrevMsg(flag,eleNm,divNm,divStatus,tdNm,errMsgNo ) -->
            <input type="hidden" id="hFlagForPrevMsg" name="hFlagForPrevMsg" value="0" >
        <!-- hidden to store for whihc Element Nm Error Msg Set -->  
            <input type="hidden" id="hFlagForPrevMsgEleNm" name="hFlagForPrevMsgEleNm" value="" >

I see from your code there is a form "frmAddPopUp". and values to various elements populated request.getAttribute("attribute name").

I think dont want to do this way instead you want to make a database call from jsp itself and propluate the values to various fields on jsp.

If this is the requirement then check these links for more information.
http://zetcode.com/tutorials/jeetutorials/mysqldatabase/
http://forums.mysql.com/read.php?39,20964

You can put the java code that is required to make a jdbc connection in a java scriptlet.Then proceed with what ever you want to do with the connection object using jdbc api.

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.