HighDots Forums  

Subject: Validation & form submission

alt.html.tags alt.html.tags


Discuss Subject: Validation & form submission in the alt.html.tags forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pat
 
Posts: n/a

Default Subject: Validation & form submission - 06-26-2004 , 05:49 PM






I have need for a page that lets me:
1. Fill out a form
2. Validate the entries using JavaScript
3. If valid, open a small window, then submit the form, with the
results flowing back to the small window.

I can specify the small window and the validation by writing:
<form .... name= testForm target="smallWindow" ... onsubmit="return
validation();"...>.
Then:
<script>
function validation() {
// validate entries, then;
smallWin=window.open"null","resultsWindow","height =300,width=
400,status=no,toolbar=no,menubar=no,location=no,le ft=200,top=200");
....
testForm.submit();
}
</script>

This opens the window, but the reply comes back in another, full sized
window, not the small one.
If I submit the form first (testForm.submit(), the reply comes back
in a large window,
then the small window is opened. If I use a submit button, the reply
shows in the small window, but then validation is bypassed.

What is the solution?

Pat

Reply With Quote
  #2  
Old   
Will Gittoes
 
Posts: n/a

Default Re: Subject: Validation & form submission - 06-29-2004 , 01:16 AM






Pat wrote:

Quote:
I have need for a page that lets me:
1. Fill out a form
2. Validate the entries using JavaScript
3. If valid, open a small window, then submit the form, with the
results flowing back to the small window.

I can specify the small window and the validation by writing:
form .... name= testForm target="smallWindow" ... onsubmit="return
validation();"...>.
Then:
script
function validation() {
// validate entries, then;
smallWin=window.open"null","resultsWindow","height =300,width=
400,status=no,toolbar=no,menubar=no,location=no,le ft=200,top=200");
You forogt the first parenthesis
...window.open("null"...
^

Quote:
....
testForm.submit();
}
/script

This opens the window, but the reply comes back in another, full sized
window, not the small one.
If I submit the form first (testForm.submit(), the reply comes back
in a large window,
then the small window is opened. If I use a submit button, the reply
shows in the small window, but then validation is bypassed.

What is the solution?

Pat
I'm not sure if I'm following.
After
testForm.submit()
can't you just have a

smallWin.location="PageThatOpens.html"

And then let the parent window handle the submission. Is that what you
wanted?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.