 |
| Javascript General Javascript discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 30th, 2004, 06:01 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
java script support htm page?
I use the image hyperlink
<FORM name="SearchForm" method="post" action="http://localhost/oracle/default.htm">
<P>
<INPUT name=search id=search ><A href="javascript:document.SearchForm.submit()"><im g src="http://localhost/oracle/Search_.gif"></A>
above linke don't display the htm page.
when I use
<FORM name="SearchForm" method="post" action="http://localhost/oracle/default.asp"> then it display the
default.asp page
how can use java script that it also display the htm page ?
regards.
Mateen
|
|

June 30th, 2004, 07:19 AM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
You cannot use html page as action, because .html are static pages.
To acheive the stated task, you have to use
<a href="http://localhost/oracle/default.htm">Default.asp</a>
Om Prakash
|
|

June 30th, 2004, 07:47 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi i tried with the following code,
it is working even for .htm also.
Please check
Cheers
Murthy
<html>
<body>
<FORM name="SearchForm" method="post" action="http://localhost:8080/practice/html/aa.htm">
<P>
<INPUT name=search id=search ><A href="javascript:document.SearchForm.submit()"><im g
src="http://localhost/oracle/Search_.gif"></A>
</body>
</html>
|
|

June 30th, 2004, 08:33 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Mateen,
It shouldn't matter whether the action attribute contains an htm / asp or other kind of page.
Out of interest, is there a reason why you can't use:
Code:
<input type="image" src="http://localhost/oracle/Search_.gif" />
in place of
Code:
<A href="javascript:document.SearchForm.submit()"><img src="http://localhost/oracle/Search_.gif"></A>
Best regards,
Chris
|
|

June 30th, 2004, 09:10 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
Submiting need Script & href doesnt accept script.
to submit ur Form using a <A> u should call submit it in OnClick of ur Image like:
Code:
<INPUT name=search id=search ><A href="void(0)" OnClick="document.SearchForm.submit();"><img src="http://localhost/oracle/Search_.gif"></A>
INSTEAD of:
Code:
<INPUT name=search id=search ><A href="javascript:document.SearchForm.submit()"><img src="http://localhost/oracle/Search_.gif"></A>
Hey somebody correct me if im wrong! (I didnt check it myself)
Always:),
Hovik Melkomian.
|
|

June 30th, 2004, 09:16 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Melvik,
I believe that either method would work.
However, I'm in agreement with Chris. His method would probably be the easiest.
Also, I'm seeing some missing closing form tags.... :-) (</form>)
HTH,
Snib
<><
|
|

June 30th, 2004, 09:54 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
SURE its easier & better, Did I say anything wrong about it?!
& also I didnt mentioned Prakash post that says u
Quote:
|
quote:can not set ur action to a HTML page
|
NO u DO can do it!
Always:),
Hovik Melkomian.
|
|

June 30th, 2004, 10:05 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
Just a Query:
What is the use of setting action as HTM page..
Like this one below:
<FORM name="SearchForm" method="post" action="http://localhost/oracle/default.htm">
Om Prakash
|
|

July 1st, 2004, 12:20 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks to all response.
it is working.(move to htm page)
<INPUT name=search id=search><A href="http://localhost/oracle/default.htm" OnClick="document.SearchForm.submit();"><img src="http://localhost/oracle/Search_.gif"></A>
regards.
Mateen
|
|

July 1st, 2004, 07:31 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
om_prakash:
It is possible to have a server parse .htm/.html pages with certain settings.
For instance, using Apache's AddType statement you can parse HTML with PHP.
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
HTH,
Snib
<><
|
|
 |