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.as p
could still get the form data.
//myform.asp
<script type="text/javascript">
function checkformdata()
{ //etc...
document.myform .submit();
}
</script>
<form name="myform" action="formres ponse.asp" method="post"
onsubmit="check formdata()">
//controls etc...
</form>
//formresponse.as p
<%= Request.Form %> 3 1421
In article <ba************ *************@p osting.google.c om>, 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.as p 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
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.as p could still get the form data.
//myform.asp <script type="text/javascript"> function checkformdata() { //etc... document.myform .submit(); } </script>
<form name="myform" action="formres ponse.asp" method="post" onsubmit="check formdata()"> //controls etc... </form>
//formresponse.as p <%= 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="docume nt.myform.submi t()".
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="retur n checkFormData() ">
Brian This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 has not yet click the submit button to submit the form, the
system need to automatically submit it.
So, can anyone teach me how to check the time out as well as how to
make the form submit automatically? Thank you very much.
|
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 4.5 and a good deal of the
page processing depends on whether or not a control is defined. To
prevent users from clicking on a submit button more than once or
clicking on another submit button before the page has finished
processing I have...
|
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 should be submitted as if the button is pressed. Is
this correct?
Does this behaviour vary across browsers?
Chris
|
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 finding the answer in
previous posts - I have already seen this question answered numerous
times in this forum, only problem is that the recommended method is
not available to me :-(. I know that if I could code an onclick event
on the <input...
|
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 fine.... except that the element MYBUTTON must exist as
a hidden field.
| |
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 what I'd like to have happen :
|
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 be submitted, but it
isn't for some weird reason. However, after I press the ok button, it
submits the form, and then the combo boxes start working normally. In
IE, everything works fine.
I appreciate any help. Thank you.
<html>
|
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, x2,
x3. I have no clue how to do this with a link submit.
Thanks,
|
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, because the <FORM ACTION="... tag
seems to make sure that any two submit controls in a form have to go to the
same target.
BTW, the CANCEL button does not have to submit any form data.
|
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 fields and submit the form
on another window.
Regards,
Michael
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |