Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
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
 
Old June 30th, 2004, 06:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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







 
Old June 30th, 2004, 07:19 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

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
 
Old June 30th, 2004, 07:47 AM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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>


 
Old June 30th, 2004, 08:33 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

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

 
Old June 30th, 2004, 09:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

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.
 
Old June 30th, 2004, 09:16 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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

<><
 
Old June 30th, 2004, 09:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

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.
 
Old June 30th, 2004, 10:05 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

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
 
Old July 1st, 2004, 12:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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



 
Old July 1st, 2004, 07:31 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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

<><





Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
Transformation htm of page in rss Serjio RSS and Atom 0 August 6th, 2006 02:14 AM
How to keep url end w/ index.htm when page change bekim HTML Code Clinic 3 January 25th, 2005 05:00 PM
does visual C++ support SQL script davidwong Visual C++ 1 August 17th, 2004 02:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.