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

Problem in document.formName.OnSubmit("return validationCheck(a,b,c)") event used in a function in an ASP Page

Hi There,
I have a form("myRequest.asp") and the values from it are
retrieved into the page ("output_Print.asp") on which I have two
buttons('Save As Complete' and 'Save As Incomplete'). When the 'Save
as Incomplete' button is Clicked the form will be going to the
"SaveAsincomplete.asp" without validation of the fields. And when the
'save as complete' is clicked certain fileds are to be validated and
by the function return value, if false stays in "output_Print.asp"
else, if true, it will taken to saveasComplete.asp.

Problems:
1. After the function returns false the actual values in the
"output_Print.asp" are not retaining as is.

2. The onSubmit() when used in a javaScript function as
(* document.Review.onsubmit= "return requiredCheck(valArray,
keywords, SpecPop, CntrctArray)";) is not working the way it should.

Code:

"output_Print.asp"

-------
Code for the form retrieving values and showing as
<HTML>
<BODY>
<FORM method="post" name="Revew">

var1=Request.form("Title")
var2...........
..............

Response.Write "Title:"&var1
...........
..........
......
.....

<input type=submit name="submit complete" value="Save as complete"
onClick="saveComplete('SaveInComplete.asp', this)">
<input type=submit name="Save as Incomplete" value="Save as
Incomplete" onClick="saveInComplete('SaveInComplete.asp')">
<input type=submit name="back" value="Edit Submission"
onclick=""history.back()"">
<Script language=javaScript>
function saveInComplete(var1)
{
document.Review.method ="POST";
document.Review.action=var1;
document.Review.submit();
}

function saveComplete(var1, frmName)
{
var errString="";
var rtnString="";
var valArray, keywords, SpecPop, CntrctArray

valArray=Review.valuesArray.value;
keywords=Review.Keywords.value;
SpecPop=Review.SpecPop.value;
CntrctArray=Review.CntrctArray.value;
document.Review.method ="post";
document.Review.onsubmit= "return requiredCheck(valArray, keywords,
SpecPop, CntrctArray)";

document.Review.action=var1;
document.Review.submit();
}
</script>
</form>
</body>
</html>
When I call the function in the javaScript

( Just like-- var bool=requiredCheck(valArray, keywords, SpecPop,
CntrctArray)";) its checking and returning the results correctly.
But when used in "document.Review.onsubmit= "return
requiredCheck(valArray, keywords, SpecPop, CntrctArray)";" I am not
returning (or even the function is not called) any values from the
function.

Any ideas on how to deal with this issue. Or any other method without
using the onsubmit() would be highly appreciated.

Awaiting for your suggestions,
Varun.
Jul 19 '05 #1
3 4511
"Varun" <va*****@yahoo.com> wrote in message
news:4e**************************@posting.google.c om...
2. The onSubmit() when used in a javaScript function as
(* document.Review.onsubmit= "return requiredCheck(valArray,
keywords, SpecPop, CntrctArray)";) is not working the way it should. function saveComplete(var1, frmName)
{
var errString="";
var rtnString="";
var valArray, keywords, SpecPop, CntrctArray

valArray=Review.valuesArray.value;
keywords=Review.Keywords.value;
SpecPop=Review.SpecPop.value;
CntrctArray=Review.CntrctArray.value;
document.Review.method ="post";
document.Review.onsubmit= "return requiredCheck(valArray, keywords,
SpecPop, CntrctArray)";

document.Review.action=var1;
document.Review.submit();
}


Why not just do something like this:

function saveComplete(var1, frmName)
{
var errString="";
var rtnString="";
var valArray, keywords, SpecPop, CntrctArray

valArray=Review.valuesArray.value;
keywords=Review.Keywords.value;
SpecPop=Review.SpecPop.value;
CntrctArray=Review.CntrctArray.value;
document.Review.method ="post";

document.Review.action=var1;
return requiredCheck(valArray, keywords,SpecPop, CntrctArray);
}

I think that will work for you.
Regards,
Peter Foti
Jul 19 '05 #2
"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message news:<10*************@corp.supernews.com>...
"Varun" <va*****@yahoo.com> wrote in message
news:4e**************************@posting.google.c om...
2. The onSubmit() when used in a javaScript function as
(* document.Review.onsubmit= "return requiredCheck(valArray,
keywords, SpecPop, CntrctArray)";) is not working the way it should.

function saveComplete(var1, frmName)
{
var errString="";
var rtnString="";
var valArray, keywords, SpecPop, CntrctArray

valArray=Review.valuesArray.value;
keywords=Review.Keywords.value;
SpecPop=Review.SpecPop.value;
CntrctArray=Review.CntrctArray.value;
document.Review.method ="post";
document.Review.onsubmit= "return requiredCheck(valArray, keywords,
SpecPop, CntrctArray)";

document.Review.action=var1;
document.Review.submit();
}


Why not just do something like this:

function saveComplete(var1, frmName)
{
var errString="";
var rtnString="";
var valArray, keywords, SpecPop, CntrctArray

valArray=Review.valuesArray.value;
keywords=Review.Keywords.value;
SpecPop=Review.SpecPop.value;
CntrctArray=Review.CntrctArray.value;
document.Review.method ="post";

document.Review.action=var1;
return requiredCheck(valArray, keywords,SpecPop, CntrctArray);
}

I think that will work for you.
Regards,
Peter Foti


Ya, your idea was right and works if requiredCheck() returns
false(the onClick event has valse flase and does nothing(that is what
we wanted). But if the requiredCheck() returns true, since we are not
mentioning the document.Review.submit(); there is no action taking
place for which it should execute the form whatever.asp.

I have come up with this idea (glad that it worked):

function saveComplete(formaction, frmName)
{
var errString="";
var rtnString="";
document.Review.method ="post";
rtnString=requiredCheck(frmName);
if (rtnString){
document.Review.action=formaction;
document.Review.submit();
}
else {
return false;}
}

Thank you for your time in replying to this message.

Good Day.
Varun.
Jul 19 '05 #3
"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message news:<10*************@corp.supernews.com>...
"Varun" <va*****@yahoo.com> wrote in message
news:4e**************************@posting.google.c om...
2. The onSubmit() when used in a javaScript function as
(* document.Review.onsubmit= "return requiredCheck(valArray,
keywords, SpecPop, CntrctArray)";) is not working the way it should.

function saveComplete(var1, frmName)
{
var errString="";
var rtnString="";
var valArray, keywords, SpecPop, CntrctArray

valArray=Review.valuesArray.value;
keywords=Review.Keywords.value;
SpecPop=Review.SpecPop.value;
CntrctArray=Review.CntrctArray.value;
document.Review.method ="post";
document.Review.onsubmit= "return requiredCheck(valArray, keywords,
SpecPop, CntrctArray)";

document.Review.action=var1;
document.Review.submit();
}


Why not just do something like this:

function saveComplete(var1, frmName)
{
var errString="";
var rtnString="";
var valArray, keywords, SpecPop, CntrctArray

valArray=Review.valuesArray.value;
keywords=Review.Keywords.value;
SpecPop=Review.SpecPop.value;
CntrctArray=Review.CntrctArray.value;
document.Review.method ="post";

document.Review.action=var1;
return requiredCheck(valArray, keywords,SpecPop, CntrctArray);
}

I think that will work for you.
Regards,
Peter Foti


Ya, your idea was right and works if requiredCheck() returns
false(the onClick event has valse flase and does nothing(that is what
we wanted). But if the requiredCheck() returns true, since we are not
mentioning the document.Review.submit(); there is no action taking
place for which it should execute the form whatever.asp.

I have come up with this idea (glad that it worked):

function saveComplete(formaction, frmName)
{
var errString="";
var rtnString="";
document.Review.method ="post";
rtnString=requiredCheck(frmName);
if (rtnString){
document.Review.action=formaction;
document.Review.submit();
}
else {
return false;}
}

Thank you for your time in replying to this message.

Good Day.
Varun.
Jul 19 '05 #4

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

Similar topics

2
by: Hennie de Nooijer | last post by:
Because of an error in google or underlying site i can reply on my own issue. Therefore i copied the former entered message in this message....
2
by: Paolo Mancini | last post by:
Hi all, I have a page with many different elements: <a href="...."> ... </a>, listboxes, radiobuttons, etc. Can I use javascript to prevent the user from interacting with the page? That is:...
3
by: Don | last post by:
I can successfully force submission of a <form> using "document.formname.submit()". But, the submission doesn't appear to occur when used with Netscape. Anybody know why this is happening, and...
2
by: Scott | last post by:
I need to write a function that copies variables to fields. I've used an array and loop because it's neater than writing a similar sentence out 10 times. var myString = new...
10
by: Data Guy | last post by:
In my approach to validation for widgets, i write javascript functions. At the end of the document, inside the form, i invoke the function as <FORM NAME="testit"> <INPUT TYPE="TEXT" VALUE="2"...
7
by: michael | last post by:
apologies in advance, as not only am i new to learning how to code javascript properly, i'm new to the groups posting thing... i am developing in firefox 1.0+, but will be working in an msie 6.0+...
3
by: Jason | last post by:
I have an ASP.NET application in which I would like to call my button click event (imgSubmitSearch_Click) on the page load if certain criteria are met. Is this possible? What is the correct...
4
by: JV | last post by:
I thought I once saw somewhere that a global variable, "xyz" for example, could be declared and used so that instead of using "document.formname.elementname.value" one could use...
1
by: nupuragr82 | last post by:
I have a parent form and on button click I am calling a child page where i have a textbox and a button. On button click of child form I am passing the value of the Textbox to the Textbox in parent...
3
by: sarvanhsr | last post by:
Hai, I have one problem..we finshed a project.. using document.formname.submit() to submit the form....It's all well working in IE and FIREFOX and remains like mud in safari browser.. nothing...
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: 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
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
marktang
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,...
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
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...

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.