user3223205
user3223205

Reputation:

how to submit html form with current hash location

I have a HTML form which i want to be able to submit with the current hash location

<form action="editcustomer.php?seq=<?php echo $_GET["seq"]; ?>#" method="post" name="form1">

Is this possible?

Upvotes: 1

Views: 1625

Answers (1)

benzkji
benzkji

Reputation: 1867

To get the current hash value, you'll need something like this:

<form onSubmit="this.action='editcustomer.php'+location.hash" action="editcustomer.php" method="post" name="form">

off topic: It's common practice to do this, as it makes it possible to jump to the added anchor point, for example directly to the submitted form (#form-xy), thus enhancing user experience.

Upvotes: 2

Related Questions