Re: problem with form
| From: | Hugh Bothwell | Date: | Tue, 10 Jul 2001 13:13:00 +0000 |
| Subject: | Re: problem with form | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-10211@lists.php.net to get a copy of this message | ||
Try setting form.action and using form.submit() to send it ('edit.php' is
not valid javascript).
Here:
<html><head><script><!--
function submitTo(form, url) {
form.action = url;
form.submit();
}
--></script></head><body>
<form name="f" action="submit.php">
<input type="submit"
name="Submit"
value="Submit Request"
onclick="submitTo(document.f, 'submit.php')"
>
<input type="submit"
name="Edit"
value="Edit Request"
onclick="submitTo(document.f, 'edit.php')"
>
</form>
</body>
Note that this includes a fall-back: if JavaScript is not supported, the
form will be submitted by either button.
"Jennifer Arcino Demeterio" <eper@tridel.net> wrote in message
news:000a01c1092d$0c3baba0$8d00a8c0@imanila.com.ph...
> hello,
>
> hope anyone has an idea on how to fix this...
>
> <form>
> <input type="submit" name="Submit" value="Submit Request"
> OnClick="submit.php" class="button">
> <input type="submit" name="Edit" value="Edit Request"
> OnClick="edit.php"
> class="button">
> </form>
>
> even i click on the edit button, it will still go to submit.php page, why
is
> that?
>
> thanks