Click to See Complete Forum and Search --> : Form Submit Problem


Asim
10-21-2003, 02:02 AM
Hi
I have a problem with form submit. I am new to Javascript and dont know the exact syntex. I have two form action 1) is when user change the combo, form submit itself and 2) is an image and when user clicks it has to sumbitted on next page. My page name is category.asp so in formaction I used this name to submit the form itself and on image click event I used the javascript. the combo is working perfect but image click is not working. My code is as follows
<script language="JavaScript">
function SubmitForm()
{
document.a.action = "style.asp"
document.a.submit();
}
</script>

<form action="category.asp" method="post" name="a">
<select class="PulRtxt" onchange="form.submit()" size="1" name="categoryid">
<option categoryid=1>ABC</option>
</select>
<input src="go.gif" name="I1" onClick="SubmitForm()" type="image">
</form>

Pls Help me
Thanks in advance
Asim

Gollum
10-21-2003, 02:10 AM
When you say "image click is not working", what is it (or not) doing?

Asim
10-21-2003, 02:19 AM
Thanks
See The derfault form action is for combo right but for image click I want anonther action of form which is different from the form default action .When I said Its not working means the action in Javascript is not working i.e.(Style.asp). But I put comment on
//document.a.action = "stylehome.asp"_
then form is submitting but itself that is its default action, which i dont want. I want different action on image click
If u have any question feel free to ask. I really need hel caz I am stuck.
Asim

Gollum
10-21-2003, 02:30 AM
As far as I can tell, it should work. What error are you getting?

Asim
10-21-2003, 02:54 AM
Thanks for your reply
I have fixed it the code was perfect I have some formatting error in html
Thanks agains
Asim