Solved

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

Posted on 2004-03-31
2
287 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Magento Indexing 1 98
Microsoft Edge 9 101
replace quotes with UTF-8 character 38 98
SP to delete duplicates 15 71
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

825 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