Hi all,
I want to submit a form after confirmation through a customised window. I have 4 buttons in <af:form>, one of which is continue button that has to navigate the form to another page while executing the action:
-------------------------------------------------------- - <af:commandButton id="continueBtn"
-
onclick="return NewWindow()"
-
action="#{CoverageMPB.process}" text="continue" />
----------------------------------------------------------------
javascript :
------------------------------------------------------------------- - function NewWindow(){
-
window.open("url","fg","height=250,width=700");
-
return false;
-
}
-
-
function check(){
-
if(document.forms[0].radios[0].checked){
-
self.close();
-
document.parent.getElementById("my_form").submit();
-
//my_form is the id of <af:form> that is the parent document's form.
-
}
-
else {
-
self.close();
-
}
-
}
-------------------------------------------------------------------------
child window: (jsf file)
---------------------------------------------------------------- - <af:form id="form1" >
-
<af:panelBorder id="boder1">
-
<af:panelForm labelWidth="5%" id="form2">
-
<af:panelHorizontal>
-
<af:selectOneRadio id="radios" layout="horizontal" value="" onclick="check()">
-
<af:selectItem label="Yes" value="Yes"></af:selectItem>
-
<af:objectSpacer width="5"/>
-
<af:selectItem label="No" value="No"></af:selectItem>
-
</af:selectOneRadio>
-
</af:panelHorizontal>
-
</af:panelForm>
-
</af:panelBorder>
-
</af:form>
------------------------------------------------------------------------------------------
Can anybody help me in finding out why the form is not getting submitted when i click on Yes?
9 5480 gits 5,390
Recognized Expert Moderator Expert
hi ...
change this: - document.parent.getElementById("my_form").submit();
-
to: - opener.document.getElementById("my_form").submit();
kind regards
Hi,
Thanks for replying. But I've tried putting even that statement. But its not working.
gits 5,390
Recognized Expert Moderator Expert
try an alert before that statement ... may be you should close the window after! trying to submit?
kind regards
gits 5,390
Recognized Expert Moderator Expert
and try to trace whether your condition returns true!
kind regards
yeah i have done that also. it does return true and it can even click another button in parent form when i replaced submit statement with getElementById( "button2id").cl ick();.
I mean condition is being satisfied for sure and it is able to access the parent form's elements. But doesn't submit the form
and try to trace whether your condition returns true!
kind regards
gits 5,390
Recognized Expert Moderator Expert
i'm confused now ... is it a popup window or a frame? please try to explain the related application-design very clear ... in case you have a frame ... then you have a parent ... in case you have a popupwindow or another window at all ... it should be the opener. please explain it in more detail ...
kind regards
ok. see, I have page1.jsf that has submit button. when i click on this button a pop up window should be opened that has a group of 2 radio buttons: "Yes" and "No". Upon selecting any radio button, pop up should be closed. further, if "yes" was selected, page should be submitted.
i'm confused now ... is it a popup window or a frame? please try to explain the related application-design very clear ... in case you have a frame ... then you have a parent ... in case you have a popupwindow or another window at all ... it should be the opener. please explain it in more detail ...
kind regards
gits 5,390
Recognized Expert Moderator Expert
hi ...
in this case the following function should work: -
function check() {
-
if (document.forms[0].radios[0].checked) {
-
opener.document.getElementById('my_form').submit();
-
}
-
-
window.close();
-
}
try it and let me know whether you get any errors with that or not?
kind regards
HI, it was also not working. Then, I changed the logic. Instead of submitting, I am now, clicking that button again and based on a variable (hidden field), making it return true. Now, it's working fine. Anyways, thanks for responses.
hi ...
in this case the following function should work: -
function check() {
-
if (document.forms[0].radios[0].checked) {
-
opener.document.getElementById('my_form').submit();
-
}
-
-
window.close();
-
}
try it and let me know whether you get any errors with that or not?
kind regards
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Joel |
last post by:
Hi there,
My original window (A) opens a modal dialog window (B).
In B, you fill out a form and submit it to itself for
processing. When B reloads, it knows that is successfully
processed the form and it suppose to close itself after
returning "1" or "0" to A.
My problem is that B will never close. When I submit it,
it kind of opens a new window and close that one before
|
by: Terence Parker |
last post by:
How does one go about submitting a form with a link - but submitting
it to a new window AND to a page different to that described within
the action="" option of the <form> tag?
Say, for example, I have a simple form such as the following:
<form method="POST" action="submit.php" name="AForm">
Name: <input type="text" name="Name" length="20"><br>
Age: 15 <a href="age.php">change age</a><br>
<input type="submit" name="submit"...
|
by: John Kiernan |
last post by:
Hey JavaScript gurus...
I'm going to try this again. I haven't gotten as much help as I have advice
on style<grin>. I appreciate (having programmed in other languages for
quite a while) that everyone has their own opinion on HOW things should be
done. However, if it does not comes AFTER helping me figure out my problem,
please... (fill in your own polite way to say 'save the bandwidth').
I have code in a MouseUp of my save button...
|
by: jforena |
last post by:
Hi,
I am trying to create a javascript that will display a confirmation
message when a user submits a form and has specifically selected
a particular radio button.
For example:
<form action="foo.cgi" method="post">
<input name="question1" type="radio" value="1">Value 1</input>
|
by: Codeman II |
last post by:
Hi there,
I am building a form where the user must upload a picture and fill in his
details.
Now I have a problem as all of this is on the same form.
How will I be able to have the Browse button to open the "file browse"
dialog
and the Submit button to submit the form data.
| |
by: b3t1m0s |
last post by:
Hi everyone here!
I have a special case and I want to ask can I realize this in JavaScript/AJAX.
The case is:
I have html submit form that should send data to php file.
When submit button is pressed a "popup" or modal windows must be displayed and user must click in page (ex. image), and page should open a new window (from image hyperlink ex.) and return to the main page (submit form) to finally send data to php file.
Is this realized in...
|
by: oll3i |
last post by:
my javascript function doesnt work on submit?
<form method="post" action="" name="client_form" onsubmit="return checkForm(this,<?echo $number ?>,<?echo $language?>);">
function checkForm(form,number,language){
|
by: V S Rawat |
last post by:
using Javascript, I am opening a web-based url in a popup window.
MyWin1=Window.Open(url, "mywindow")
There is a form (form1) in the url in that popup window, I need to
submit that form.
How do I submit that form1 from the javascript from my current window?
Thanks.
|
by: John Straumann |
last post by:
Hi all:
I have an ASP.NET form that submits info to the server, but the customer
wants a confirmation window to open when the user clicks "Submit", and then
the user would have to click "OK" on the popup window to have the main form
submit. I found some samples of using JavaScript to create a popup window,
but then the OnClick event for the form button runs the JavaScript as
opposed to the server side code.
Can anyone suggest how I...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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: 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.
| |