473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Javascript Form Submit Error - Please HELP!

Ok, I have done this a million times, and I can't get this to work...
I hope I am just being an idiot and missing something... but I can't
see it... so please call me an idiot and tell me what it is...

<code>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<title>Online Orientation Quiz</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="javascript">
<!--
function myFunction(myRadioGroup,myCorrectAnswer){
var pointValue=0;
var answerChosen=false;
for (var i=0; i<document.myForm[myRadioGroup].length; i++) {
if (document.myForm[myRadioGroup][i].checked) {
if(document.myForm[myRadioGroup][i].value==myCorrectAnswer){
answerChosen=true;
//alert(myRadioGroup+' is correct.');
pointValue++;
} else {
pointValue=0;
};
} ;
};
if (!answerChosen){
pointValue=0;
}
return pointValue;
};

function validate()
{
alert(document.forms(0).submit());
}

//-->
</script>
<link href="http://www.fvtc.edu/style.css" rel="stylesheet"
type="text/css">
</HEAD>
<body>
<h2><IMG alt="Orientation Logo"
src="http://www.fvtc.edu/Files/OrietationLogo201-43111414.jpg"
align="right"> Online&nbsp;Orientation Quiz</h2>

<form name="myForm" method=post action="mytarget.html" id="myForm">
<OL>
<li>
Students may access their personal information online through
_____<br>
<br>
<input type="radio" name="radQ1" value="Yahoo" ID="Radio13">
&nbsp;
<label for="Radio13">Yahoo!</label><BR>
<input type="radio" name="radQ1" value="Hotmail" ID="Radio14">
&nbsp;
<label for="Radio14">Hotmail</label><BR>
<input type="radio" name="radQ1" value="MyFVTC" ID="Radio37">
&nbsp;
<label for="Radio37">MyFVTC</label><BR>
<input type="radio" name="radQ1" value="Web Advisor" ID="Radio76">
&nbsp;
<label for="Radio76">Web Advisor</label><BR>
<BR>
<li>
Dropping courses or a program at FVTC is a _____
responsibility.<br>
<br>
<input type="radio" name="radQ2" value="Counselors" ID="Radio1">
&nbsp;
<label for="Radio1">Counselor's</label><BR>
<input type="radio" name="radQ2" value="Students" ID="Radio2">
&nbsp;
<label for="Radio2">Student's</label><BR>
<input type="radio" name="radQ2" value="Registration" ID="Radio3">
&nbsp;
<label for="Radio3">Registration</label><BR>
<input type="radio" name="radQ2" value="Parents" ID="Radio4">
&nbsp;
<label for="Radio4">Parent's</label><BR>
<BR>
<li>
When planning your schedule and for any advice regarding your
program or a
personal nature, you should seek the advice of:<br>
<br>
<input type="radio" name="radQ3" value="Webmaster" ID="Radio5">
&nbsp;
<label for="Radio5">Webmaster</label><BR>
<input type="radio" name="radQ3" value="Dean of Students"
ID="Radio6"> &nbsp;
<label for="Radio6">Dean of Students</label><BR>
<input type="radio" name="radQ3" value="Academic Counselor"
ID="Radio7"> &nbsp;
<label for="Radio7">Academic Counselor</label><BR>
<input type="radio" name="radQ3" value="Another student"
ID="Radio8"> &nbsp;
<label for="Radio8">Another student</label><BR>
<BR>
<li>
A prerequisite is something you must do, or a class you must take,
before you
enroll in the next one that specifically requires it?
<br>
<br>
<input type="radio" name="radQ4" value="True" ID="Radio9"> &nbsp;
<label for="Radio9">True</label><BR>
<input type="radio" name="radQ4" value="False" ID="Radio10">
&nbsp;
<label for="Radio10">False</label><BR>
<BR>
<LI>
As an FVTC student, you are responsible for any communication that
is made
available to you.&nbsp; Important college information will be sent
via:
<br>
<br>
<input type="radio" name="radQ5" value="My home" ID="Radio11">
&nbsp;
<label for="Radio11">My home</label><BR>
<input type="radio" name="radQ5" value="My FVTC e-mail"
ID="Radio12"> &nbsp;
<label for="Radio12">My FVTC e-mail</label><BR>
<input type="radio" name="radQ5" value="My parents" ID="Radio15">
&nbsp;
<label for="Radio15">My parents</label><BR>
<input type="radio" name="radQ5" value="Another student"
ID="Radio16"> &nbsp;
<label for="Radio16">My cell phone</label><BR>
<BR>
<LI>
Student ID's are needed on campus.&nbsp; I can obtain that at:<br>
<br>
<input type="radio" name="radQ6" value="Registration"
ID="Radio17"> &nbsp;
<label for="Radio17">Registration</label><BR>
<input type="radio" name="radQ6" value="Student Life"
ID="Radio18"> &nbsp;
<label for="Radio18">Student Life</label><BR>
<input type="radio" name="radQ6" value="Information Center"
ID="Radio19"> &nbsp;
<label for="Radio19">Information Center</label><BR>
<input type="radio" name="radQ6" value="My classroom"
ID="Radio20"> &nbsp;
<label for="Radio20">My classroom</label><BR>
<BR>
<LI>
If I drop a class, in order to get a 100% refund I will need to
contact
Registration:
<br>
<br>
<input type="radio" name="radQ7" value="The day the class starts"
ID="Radio21">
&nbsp;
<label for="Radio21">The day the class starts</label><BR>
<input type="radio" name="radQ7" value="One business day prior to
the day the class starts"
ID="Radio22"> &nbsp;
<label for="Radio22">One business day prior to the day the class
starts</label><BR>
<input type="radio" name="radQ7" value="Anytime" ID="Radio23">
&nbsp;
<label for="Radio23">Anytime</label><BR>
<BR>
<LI>
If I need to be contacted while in class, an all school page will
be given so I
can pick up a message:<br>
<br>
<input type="radio" name="radQ8" value="True" ID="Radio24"> &nbsp;
<label for="Radio24">True</label><BR>
<input type="radio" name="radQ8" value="False" ID="Radio25">
&nbsp;
<label for="Radio25">False</label><BR>
<BR>
<LI>
Parking at FVTC:<br>
<br>
<input type="radio" name="radQ9" value="Costs $25.00 per year"
ID="Radio26"> &nbsp;
<label for="Radio26">Costs $25.00 per year</label><BR>
<input type="radio" name="radQ9" value="Costs $25.00 each
semester" ID="Radio27">
&nbsp;
<label for="Radio27">Costs $25.00 each semester</label><BR>
<input type="radio" name="radQ9" value="Is free if I park in
student parking" ID="Radio28">
&nbsp;
<label for="Radio28">Is free if I park in student
parking</label><BR>
<input type="radio" name="radQ9" value="None of the above"
ID="Radio29"> &nbsp;
<label for="Radio29">None of the above</label><BR>
<BR>
<LI>
Lost and Found is located in:<br>
<br>
<input type="radio" name="radQ10" value="Student Life"
ID="Radio30"> &nbsp;
<label for="Radio30">Student Life</label><BR>
<input type="radio" name="radQ10" value="Information"
ID="Radio31"> &nbsp;
<label for="Radio31">Information</label><BR>
<input type="radio" name="radQ10" value="Security" ID="Radio32">
&nbsp;
<label for="Radio32">Security</label><BR>
<input type="radio" name="radQ10" value="Financial Aid"
ID="Radio33"> &nbsp;
<label for="Radio33">Financial Aid</label><BR>
<BR>
<LI>
Student Employment Services:<br>
<br>
<input type="radio" name="radQ11" value="Provides information on
jobs available" ID="Radio34">
&nbsp;
<label for="Radio34">Provides information on jobs
available</label><BR>
<input type="radio" name="radQ11" value="Is a resource center for
resume and interviewing tips"
ID="Radio35"> &nbsp;
<label for="Radio35">Is a resource center for resume and
interviewing tips</label><BR>
<input type="radio" name="radQ11" value="Has on campus interviews"
ID="Radio36">
&nbsp;
<label for="Radio36">Has on campus interviews</label><BR>
<input type="radio" name="radQ11" value="All the above"
ID="Radio38"> &nbsp;
<label for="Radio38">All the above</label><BR>
<input type="radio" name="radQ11" value="None of the above"
ID="Radio39"> &nbsp;
<label for="Radio39">None of the above</label><BR>
<BR>
<LI>
Special Needs is where students need to go if they are looking for
peer
tutoring.<br>
<br>
<input type="radio" name="radQ12" value="True" ID="Radio40">
&nbsp;
<label for="Radio40">True</label><BR>
<input type="radio" name="radQ12" value="False" ID="Radio41">
&nbsp;
<label for="Radio41">False</label><BR>
<BR>
<LI>
The Library has:
<br>
<br>
<input type="radio" name="radQ13" value="Rooms for small groups to
meet" ID="Radio42">
&nbsp;
<label for="Radio42">Rooms for small groups to meet</label><BR>
<input type="radio" name="radQ13" value="Internet resources"
ID="Radio43"> &nbsp;
<label for="Radio43">Internet resources</label><BR>
<input type="radio" name="radQ13" value="Resource loans from other
schools" ID="Radio44">
&nbsp;
<label for="Radio44">Resource loans from other schools</label><BR>
<input type="radio" name="radQ13" value="Computer access"
ID="Radio45"> &nbsp;
<label for="Radio45">Computer access</label><BR>
<input type="radio" name="radQ13" value="All of the above"
ID="Radio47"> &nbsp;
<label for="Radio47">All of the above</label><BR>
<input type="radio" name="radQ13" value="None of the above"
ID="Radio46"> &nbsp;
<label for="Radio46">Two of the above</label><BR>
<BR>
<LI>
For fall 2005 classes, my tuition fees are due on:<br>
<br>
<input type="radio" name="radQ14" value="July 27, 2005"
ID="Radio48"> &nbsp;
<label for="Radio30">July 27, 2005</label><BR>
<input type="radio" name="radQ14" value="The first day of class"
ID="Radio49"> &nbsp;
<label for="Radio31">The first day of class</label><BR>
<input type="radio" name="radQ14" value="August 15, 2005"
ID="Radio50"> &nbsp;
<label for="Radio32">August 15, 2005</label><BR>
<input type="radio" name="radQ14" value="June 30, 2005"
ID="Radio51"> &nbsp;
<label for="Radio33">June 30, 2005</label><BR>
<BR>
</LI>
</OL>
<p align="center">
<input type="button" name="submit" value="Submit" ID="Button1"
onclick="validate();">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" name="Submit2"
value="Reset" ID="Reset1">
</p>
</form>
<P>&nbsp;</P>
</body>
</HTML>
</code>

Jul 23 '05 #1
8 1964
Ok, that line that says...
alert(document.forms(0).submit())
was at one time...
document.forms(0).submit;
and
document.myForm.submit();

both of which gave me an 'Object does not support this property or
method' error... I really did have that code in there at one time, I
swear it, but that didn't work either

Jul 23 '05 #2
sh******@gmail.com wrote:
document.forms(0).submit;
document.forms[0].submit();
document.myForm.submit();


document.forms["myForm"].submit();

Both are valid, the second is preferred.

--
Matt Kruse
http://www.JavascriptToolbox.com
Jul 23 '05 #3
I tried both and still get the same error... I created a new document
to try to see if I could get it working... its at

http://deptets.fvtc.edu/tryme.html

very plain... check the lengthof a text box, which it does, but I
still get the same error... Object does not support this property or
method...

BTW, thank you for looking at this with me...
Matt Kruse wrote:
sh******@gmail.com wrote:
document.forms(0).submit;


document.forms[0].submit();
document.myForm.submit();


document.forms["myForm"].submit();

Both are valid, the second is preferred.

--
Matt Kruse
http://www.JavascriptToolbox.com


Jul 23 '05 #4


sh******@gmail.com wrote:
Ok, I have done this a million times, and I can't get this to work...
I hope I am just being an idiot and missing something... but I can't
see it... so please call me an idiot and tell me what it is...
You're an idiot.

OK, so you're *not* an idiot, just trying to be cooperative.

(snip)
<p align="center">
<input type="button" name="submit" value="Submit" ID="Button1"
onclick="validate();">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" name="Submit2"
value="Reset" ID="Reset1">


Very common error: you've named your submit button "submit",
overwriting the Form.submit property - which holds the Form.submit()
method. Try something else.

Please don't post tabbed code. Read the faq.

Jul 23 '05 #5
Man, I am an idiot... I even knew that one!! Thank you!!! Sorry
about the code.. Thank you very very much!

Jul 23 '05 #6


RobB wrote:
sh******@gmail.com wrote:
Ok, I have done this a million times, and I can't get this to work...
I hope I am just being an idiot and missing something... but I can't
see it... so please call me an idiot and tell me what it is...


You're an idiot.

OK, so you're *not* an idiot, just trying to be cooperative.

(snip)
<p align="center">
<input type="button" name="submit" value="Submit" ID="Button1"
onclick="validate();">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" name="Submit2"
value="Reset" ID="Reset1">


Very common error: you've named your submit button "submit",
overwriting the Form.submit property - which holds the Form.submit()
method. Try something else.

Please don't post tabbed code. Read the faq.


Hmm...just noticed - that isn't a submit button, but a generic button
with its onclick handler wired for submission. Why? Now the js-disabled
crowd loses out. Drop the handler, make it a true submit button, and
call the validator from the form's onsubmit handler:

<form....onsubmit="return validate()">

Presumably you'll want to validate something as well...

(& you're welcome !)

Jul 23 '05 #7
sh******@gmail.com wrote:
I tried both and still get the same error... I created a new
document to try to see if I could get it working... its at
http://deptets.fvtc.edu/tryme.html


The reason is that your button is named 'submit'.

Try this:

<html>
<head>
<script type="text/javascript">
function validate(){
if(document.forms["myform"].Text1.value.length>0){
document.forms["myform"].submit();
} else {
alert("enter something in the box");
}
}
</script>
</head>
<body>
<form name="myform" action="myfile.html" method="get">
<input type="text" ID="Text1" NAME="Text1"><br>
<input type="button" name="submitButton" value="Submit" ID="Button1"
onclick="validate();">
</form>
</body>
</html>
--
Matt Kruse
http://www.JavascriptToolbox.com
Jul 23 '05 #8
sh******@gmail.com wrote:
Ok, that line that says...
alert(document.forms(0).submit())
was at one time...
document.forms(0).submit;
and
document.myForm.submit();

both of which gave me an 'Object does not support this property or
method' error... I really did have that code in there at one time, I
swear it, but that didn't work either


Rename your submit button, your references are ambiguous.
Mick
Jul 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steph | last post by:
Hello, Can someone tell me the script to use for having a change on the same page when using checkbox function ? For example, i would to check one condition and display dynamically a button...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: ...
4
by: houstoncity2004 | last post by:
Hi, I need help to JavaScript. I am new to this, and am trying to the page online ASAP. I have two submit buttons on one form, and each button will have to do different things. I named both...
1
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
1
by: dreamlab | last post by:
Hello, Can one of you javascript wizards help out a newbie, please? I’ve got a formHandler that is supposed to check for a good email address and name in the form after clicking the submit...
1
by: JumpingOffPlace | last post by:
Hi, I'm hoping that the wealth of knowledge here can stop me from spinning my wheels on this syntax error for hours. :) Below is the code, and the error I am recieving.... Code: <!DOCTYPE...
5
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
13
by: Mtek | last post by:
Hi, We have a form defined with buttons like this: <a class="save_menu" href="javascript:document.Detail_Screen.action = 'savedata.php?screen=EDIT';document.Detail_Screen.submit();">Update</...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.