Hi,
Is there a way to update the same web page instead of getting a new
page each time we click the submit button? The simplest thing to do is
to delete the current page (or go back to the previous page) and then
redraw the page. There are a few possible solutions:
1. Use the same URL again. But a new page will still be created.
2. Use the "onsubmit" option:
<form ACTION="testnet .pl" method="post"
ONSUBMIT="javas cript:history.g o(-1); return false;">
.... <input..>
but the browser goes back to the previous page yet does not
continue to the ACTION part to draw the same page with new data.
3. Leave the page alone and use a customized javascript to update the
input fields of the current page:
<script language="javas cript" >
function UPDATE(obj) {
frm1.txt1.value = Date().toLocale String();
}
....
<form name="frm1">
<input name="foo" ONCLICK="UPDATE (this)" type="button">
4. Someone mentioned that one can post the form to itself. But he/she
did not explained the details.
By using javascript this way, the program still works as usual even if
javascript is turned off. Has anyone done this before?
Is there a way to update the same web page instead of getting a new
page each time we click the submit button? The simplest thing to do is
to delete the current page (or go back to the previous page) and then
redraw the page. There are a few possible solutions:
1. Use the same URL again. But a new page will still be created.
2. Use the "onsubmit" option:
<form ACTION="testnet .pl" method="post"
ONSUBMIT="javas cript:history.g o(-1); return false;">
.... <input..>
but the browser goes back to the previous page yet does not
continue to the ACTION part to draw the same page with new data.
3. Leave the page alone and use a customized javascript to update the
input fields of the current page:
<script language="javas cript" >
function UPDATE(obj) {
frm1.txt1.value = Date().toLocale String();
}
....
<form name="frm1">
<input name="foo" ONCLICK="UPDATE (this)" type="button">
4. Someone mentioned that one can post the form to itself. But he/she
did not explained the details.
By using javascript this way, the program still works as usual even if
javascript is turned off. Has anyone done this before?
Comment