473,383 Members | 1,922 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,383 software developers and data experts.

submit question

When the user click the submit button in myform.asp, then it will
invoke the
javascript to check the form data. I want to know if we need
document.myform.submit(); ?? Because even I comment it out,
formresponse.asp
could still get the form data.

//myform.asp
<script type="text/javascript">
function checkformdata()
{ //etc...
document.myform.submit();
}
</script>

<form name="myform" action="formresponse.asp" method="post"
onsubmit="checkformdata()">
//controls etc...
</form>

//formresponse.asp
<%= Request.Form %>
Jul 23 '05 #1
3 1409
In article <ba*************************@posting.google.com> , Matt
says...
When the user click the submit button in myform.asp, then it will
invoke the
javascript to check the form data. I want to know if we need
document.myform.submit(); ?? Because even I comment it out,
formresponse.asp
could still get the form data.


Didn't you multi-post this to alt.html? Naughty boy.

--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php
Jul 23 '05 #2
In article <ba*************************@posting.google.com> ,
jr********@hotmail.com enlightened us with...
When the user click the submit button in myform.asp, then it will
invoke the
javascript to check the form data. I want to know if we need
document.myform.submit();


No; it's redundant in the code you posted.
Remove it.

--
--
~kaeli~
You feel stuck with your debt if you can't budge it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
Matt wrote:
When the user click the submit button in myform.asp, then it will
invoke the
javascript to check the form data. I want to know if we need
document.myform.submit(); ?? Because even I comment it out,
formresponse.asp
could still get the form data.

//myform.asp
<script type="text/javascript">
function checkformdata()
{ //etc...
document.myform.submit();
}
</script>

<form name="myform" action="formresponse.asp" method="post"
onsubmit="checkformdata()">
//controls etc...
</form>

//formresponse.asp
<%= Request.Form %>


Using submit() is only for when you want to submit something through a
different means. Say, for instance, you want an anchor link to submit a
form. You can set onClick="document.myform.submit()".

When the onSubmit callback is called, it is called either because
someone pressed the submit button, or submit() was called.

Note that you should return something from your function, and return it
to the onSubmit handler. Returning true tells the form to keep going,
but returning false tells the form not to send. For instance, you might
do something like this:

<script type="text/javascript">
function checkFormData()
{
// etc...
if(dataValid)
return true;
else
{
alert("You are a naughty boy");
return false;
}
}

<FORM ... onSubmit="return checkFormData()">

Brian

Jul 23 '05 #4

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

Similar topics

2
by: shake | last post by:
I have to develop an application sounds like this:- User is allow to access a form (is actually a test/quiz) within a specific time frame, let say 45 minutes. After this 45 minutes, if the user...
6
by: JSjones | last post by:
Hi all, I'm new to these boards and my javascript experience is fairly limited and basic so please bear with me. Anyway, on to the question and some background. I'm developing using ColdFusion...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
4
by: actionwoman63 | last post by:
Dear all I need to be able to check which one out of two submit buttons within the same form was pressed in a javascript function prior to form submission. And before I get flamed for not...
6
by: charlie_M | last post by:
I figured out via various help from this forum... EXAMPLE: onClick="document.forms.MYBUTTON.value='SIMPLE';document.forms.submit()" In my CGI I see "MYBUTTON" = "SIMPLE" and this works...
4
by: gimme_this_gimme_that | last post by:
Hi, This is sort of a : How to build a Yes/No dialog box qquestion. Or perhaps a question about getting javascript variables from a pop-up window and processing them on a submit. This is...
5
by: Pascal Batzli Jr | last post by:
Hello, I have a strange situation happening on the code below. When I first load the page, as I change any of the three combo boxes I have created, the onchange event is fired and the form should...
26
by: Mica Cooper | last post by:
Hi, I need to pass some info in a javascript submit. <a href="javascript:document.formName.submit();">Submit Form</a> Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1,...
7
by: David T. Ashley | last post by:
Hi, For a web page, I want a SUBMIT button that commits the form data and a CANCEL button that goes to a different target (i.e. a different script). I haven't figured out how to do this,...
4
by: MichaelK | last post by:
Hello. I have all data already collected on the current page? I want to open another window with the form, fill the fields and submit that form. So basically the question is how can I fill all...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?

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.