Urgent: Please Help

Hi all,

i am using an HTML form to send data to a servlet class. Now the problem is if i send the data using a submit button then it works.

But i want to use <A HREF= so that if the user just click the link then it will send the data to servlet.

But when i ckick the ><A HREF it does nothing and at the bottom left corner of the IE a message comes "Error on page"

Now my form code is

><form name="myform" action="/Final/abcd.example" method=post>

<input type=hidden name='file_name' value="<%= dbfile_name%>"/>

<input type=hidden name='file_path' value="<%= dbfile_path%>"/>

<A href="javascript:submitform()"><%= dbfile_name%></A>

</form>

and my javascript function is:

function submitform()

{

document.myform.submit();

}

please help me i am stuck with it.

Thanks

[1169 byte] By [metallicdreama] at [2007-10-2 10:57:17]
# 1
Works fine for me in IE.you might try putting an "alert" into the submitform function to see if it is being called.If you double click the IE alert on the bottom left, it should show you some indication of an error message.
evnafetsa at 2007-7-13 3:23:29 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi, y can't u use Button instead of <a >use normal button( not submit btn)ae
actionPerformeda at 2007-7-13 3:23:29 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
or use onclick attribute to <a>like<a href="#" onclick="JavaScript:submitform( frm) ">filename</a> ae
actionPerformeda at 2007-7-13 3:23:29 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Hi evnafets,The javascript message on the left says:Object doesn't support this property or methodCan you tell me what does it mean.If it works for you then why it doesn't work with me.Can you please reply.
metallicdreama at 2007-7-13 3:23:29 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Hi evnafets,The javascript message on the left says:Object doesn't support this property or methodCan you tell me what does it mean.If it works for you then why it doesn't work with me.Can you please reply.
metallicdreama at 2007-7-13 3:23:29 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Did you post your whole code or just a snippet? The example I got from the page worked find:

Debugging javascript is a pain in the butt.

but here is how you go about it:

function submitform()

{

alert("Submitting the form");

alert(document);

alert(document.myform);

alert(document.myform.action);

alert(document.myform.submit);

document.myform.submit();

}

Is there anything else on the page called "myform"?

That would confuse the matter.

evnafetsa at 2007-7-13 3:23:29 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...