473,320 Members | 1,732 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,320 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 4505
"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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.