0

Hey,
I want to send parameters via submitted form, and then to reload my jsp page:

Should I use onclick command or on submit action to transfer parameters using GET method?

My code:

<body>
        <form action="ShowPatientList.do" id="patientListForm" name="patientListForm" method = "GET">
            <p>ImiÄ™     <input id ="imie" name = "Imie" value = ""></p>
            <p>Nazwisko <input id ="nazwisko" name = "Nazwisko" value = ""></p>
            <p>Pesel    <input id ="pesel" name = "Pesel" value = ""></p>
            <input id ="subbutton" type = "submit" name="Wyszukiwanie" value = "Szukaj" onclick="">
            <c:forEach var="patient" items="${allPatients}">
                <p  onmouseover="style.backgroundColor='blue', style.cursor='pointer', style.width='320px'"
                    onmouseout="style.backgroundColor='white'"
                    onclick='method = "GET", window.location="ShowPatientDetail.do?guid="+<c:out value="${patient.guid}"/>'>
                    <c:out value="${patient.name}"/>
                    <c:out value="${patient.surname}"/>
                    <c:out value="${patient.pesel}"/>
                </p>
            </c:forEach>
        </form>
    </body>

Edited by Member 784740: n/a

2
Contributors
1
Reply
4
Views
7 Years
Discussion Span
Last Post by jaka.ramdani
0

I don't think method type matter (GET or POST) in this case, in case of form submission you better use onSubmit action rather than onClick. CMIIW.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.