[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2004-03-31
2
Medium Priority
?
292 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

649 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