0

I have from where have a one searchbox and submit button, i want to refresh the div after getting the value of searchbox

<form  action="/searchemp" method="post">
                                Employee <input type="text" name="EmployeeName" id="text1"/>
                                <input type ="submit" value="check"/>   
</form>

<div>       
        <table border="1">
            <thead> <h3 align="center">Selected Rule</h2>
                <tr>
                    <th data-field="id" width="30">ID</th>
                    <th data-field="details" width="20">RuleName</th>
                    <th data-field="parameter" width="180">Parameter&nbsp;|&nbsp; Value &nbsp;</th> 
                </tr>
            </thead>
            <c:forEach items="${List2}" var="as">
            <tr >
                <td>${as.id}</td>   
                <td>${as.ruleName}</td>
                <td>
                    <div>

                        <table>
                        <c:forEach items="${as.ruleParameter}" var="asss">  
                            <tr>
                                <td >${asss.parameterName} &nbsp;&nbsp;|&nbsp;&nbsp;</td>                                   
                                <td >${asss.parameterValue}</td>    
                            </tr>
                        </c:forEach>
                        </table>
                    </div>
                </td>           
            </tr>                           
            </c:forEach>    
    </table>
    </div>

I want to keep that searchbox value after submit. how could i do this..??please help me,

Thank you

Nirpendra Patel
  • 659
  • 7
  • 20

2 Answers2

0

You can do this through AJAX (http://api.jquery.com/load/) Useful link

More information can be found here (Refresh Part of Page (div)), a previous stack overflow

Community
  • 1
  • 1
Ronak Shah
  • 936
  • 9
  • 17
0

using XMLHttpRequest you can do this

if (window.XMLHttpRequest) { // Mozilla, Safari, IE7+ ...
    httpRequest = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE 6 and older
    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}

httpRequest.open('GET', 'http://www.example.org/some.file', true);
httpRequest.send();

Reference : https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started

stalin wesley
  • 165
  • 5
  • 13