Forum Moderators: coopster

Message Too Old, No Replies

submit form go back

         

helenp

10:56 am on Jan 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi,
I donīt know where to post this, but as the code is php so I try here.

I have an form to calculate prices and check availability, works perfect.
The only problem I have is that after you filled in the form and sent the message I want to go back to the form though I want the result displayed below the form.

Everything works except that I need to scroll down the page to go to the form, how can I go back without need of doing scroll, same as what happens when you hit go back.

This is the form:
<div class="calculator">
<p><form method="post" action="<?=$_SERVER['PHP_SELF']?>">Availability checker and price calculator:<br>
Arrival: <?php include("includes/day.php");?><?php include("includes/month.php");?>Departure: <?php include("includes/day2.php");?><?php include("includes/month2.php");?>
<input class="boton" type="Submit" name="enviar" value="Calculate">
</form> </p>
<?php
php code
?>
</div>

omoutop

3:07 pm on Jan 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you can try and automatic javahistory -1 (when code executes from from) - OR try a little anchor point

Twisted Mind

3:12 pm on Jan 13, 2006 (gmt 0)

10+ Year Member



I would use the anchor cuz javascript is not secure javascript can be a backup for forms but dont use it over server side scripting and regulair html...

helenp

5:33 pm on Jan 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



javascript can be a backup for forms but dont use it over server side scripting and regulair html...

Thanks a lot, finally I managed to do it with anchor.
I quiet donīt understan what you mean with over server side scripting and regulair html,
My site .htm pages are being parsed as .php and on several pages I use an javascript onclick goback history, any problems with that?

Twisted Mind

8:31 am on Jan 16, 2006 (gmt 0)

10+ Year Member



People can put off javascript on their browsers so it would not always be safe.

Php and normal html will always do their work properly :D.