Solved

DHTML: Submit form in a DIV tag returns a page not found error

Posted on 2004-03-31
2
285 Views
Last Modified: 2010-04-06
<DIV onClick="document.form1.submit();">Test</DIV>

When I click on that particular DIV, it redirects me to a "undefined" page. That why i get a page not found error. But when I do a alert(document.form1.action) before the submit command. It returns the correct page. If I put the same javascript on a different control for e.g. a button, it works fine.
0
Comment
Question by:ecla
2 Comments
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 250 total points
ID: 10723002
This one works for me...

<form action="http://www.google.com/" name=form1>
  <input type=hidden name=test value=1>
</form>
<DIV onClick="document.form1.submit();">Test</DIV>

may be there is problem in your form action

venkat.
0
 

Expert Comment

by:javedsiddiqui
ID: 10732053
Your search criteria for google is invalid u need to set the name attribute with correct keywor here u go with the right result keyword.

<form action="http://www.google.com/search" name=form1>
  <input type=hidden name=q value=a>
</form>
<DIV onClick="document.form1.submit();">Test</DIV>
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now