Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning 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 November 12th, 2009, 01:40 AM
Authorized User
 
Join Date: Feb 2006
Location: jaipur, rajasthan, India.
Posts: 67
Thanks: 7
Thanked 0 Times in 0 Posts
Send a message via Yahoo to beetle_jaipur
Default how to call submit function from script file

Hi,

i have one page in which i have form name finalSubmit : here is the code,

<form action="Conclude.asp" method="post" name="finalSubmit">
<input name="hiddenAnswers" type="hidden" value="" />
<input name="hiddenMarksheet" type="hidden" value="" />
<input name="btnSubmit" type="submit" value="submit form" />
</form>

and one include file : script.js

i want to make a submit call from this script.js file, like...

document.finalSubmit.submit();

but it says finalSubmit is not defined.

please help me, as i am new to javascript

best regards
 
Old November 12th, 2009, 05:08 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hmm, not sure here.

I have an HTML file that looks like this:
html Code:
<html xmlns="[url]http://www.w3.org/1999/xhtml[/url]">
<head>
 <title>Untitled Page</title>
 <script src="JScript.js" type="text/javascript"></script>
</head>
<body>
<form name="myform" action="foo">
Search: <input type='text' name='query'>
<a href="javascript: submitform()">Post Form</a>
</form>
</body>
</html>

and JScript.js looks like this:
javascript Code:
function submitform()
{
     document.myform.submit();
}

And the form submits fine. Are you sure spelled everything correctly??

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================




Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple function in submit button sougataroy BOOK: Beginning ASP 3.0 2 August 16th, 2006 06:30 PM
how to submit a form and post java script variable arabuafef ASP.NET 1.0 and 1.1 Basics 2 July 14th, 2006 09:28 PM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
Call Script function in server controll qadeerahmad General .NET 1 September 26th, 2004 11:09 PM
Call and run CGI script from a PHP script ... how? dbruins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 10th, 2003 03:09 PM





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