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. 3 4377
"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
"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.
"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. This discussion thread is closed Replies have been disabled for this discussion. Similar topics
2 posts
views
Thread by Hennie de Nooijer |
last post: by
|
2 posts
views
Thread by Paolo Mancini |
last post: by
|
3 posts
views
Thread by Don |
last post: by
|
2 posts
views
Thread by Scott |
last post: by
|
10 posts
views
Thread by Data Guy |
last post: by
|
7 posts
views
Thread by michael |
last post: by
|
3 posts
views
Thread by Jason |
last post: by
|
4 posts
views
Thread by JV |
last post: by
| | | | | | | | | | | | | |