Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     help with SUBMIT syntax
Go
New
Search
Notify
Tools
Reply
  
help with SUBMIT syntax
 Login/Join
 
Expert
posted
How can i get a SUBMIT button to have a second action, to clear the target frame while the new fex is waiting to finish?
For ex, an HREF can have an OnKlick='parent.banner.location.mynewpage.htm' to load a second or third frame in addition to performing the specified href.
But i tried this within the INPUT TYPE="submit"... and it didn't work.
I tried BUTTON TYPE="submit" etc. Didn't work.
I tried OnSubmit in the FORM tag. Didn't work.
Grateful for help. thanks.
(the K in the html above is a C, but this board won't take it)A
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Platinum Member
posted Hide Post
HTML/Javascript topic Wink

I understand you want to execute second action when first action is finished...

onsubmit must work. Try the following example.



<script type="text/javascript">
function firstAction() {
return confirm('Continue with second action?');
}
function secondAction() {
alert('Second Action');
}






1. Click the submit button
2. The form executes onsubmit (normally used for validations). onsubmit can returns true or false.
3. If onsubmit action returns true (important!) then the form executes the main action (not neccesary to be javascript like the example).

I hope this helps.
Regards,
Mikel

This message has been edited. Last edited by: <Mabel>,
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
thanks Mikel, but what i need is the OnClick event handler of the Submit button. the two events are not interdependent, so i don't need the onsubmit event handler of the form object...i'm not concerned with t/f on event 1;
Just concerned with clearing the page so that the user knows that the server is actually working on their request. so i'm aiming at the INPUT TYPE=submit..onKlick...but i just can't make it work with dom syntax:
[input type="submit" value="Go" onKlick="'parent.main.location="blue.htm"'>
Just doesn't work; How can i make it work???
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Susannah, the following code works:







Problem: If the target is the same for both actions, the browser start loading processing.html (onclick) but, at same time, before the processing.html load have finished, start the load of the submit action.

Regards,
Mikel

This message has been edited. Last edited by: <Mabel>,
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
thanks Mikel, i just can't make it work;
i get the alert boxes ok,
but i can't get the 'processing.html' to load before the fex output loads. there's plenty of time, its just the action i can't figure out.
argh! exasperated.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
<slallen>
posted
Not sure if this will help or not. Why not make your rocessing.html page the report view page as well.

I have a an application where the user makes selection then clicks a submit button. The page clears to home and a new window opens with our processing page.



SCRIPT LANGUAGE="JavaScript"
function loadReport() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
}
// End -->
/script


Using the layers we can load a screen with a processing message.


/HEAD
BODY OnLoad="loadReport()"
div id="hidepage"
table
tr
td align="center"
font face="Arial">Building report...Please Wait.
/font
/td
/tr
/table
/div


Then since the page continues to process all lines when loaded it will fire off the report.



script LANGUAGE="JavaScript"
window.location.href="/servlets/WFServlet?IBIF_ex=SC3060"
/script
/head
/body
/html


When completed the page will be displayed in the same window.

You can also define an Action dynamically using



function alter(object) {
var sl = document.feedback.Category.value;
var al = "../../scservlets/jsp/jmail.jsp";
object.encoding = 'text/plain';
object.action = al;
object.method = 'GET';
// parent.main.location.href = 'schome.htm';
}

Then in the Submit use


INPUT type="submit" value="Go" onClick="alter(this.form)"

This message has been edited. Last edited by: <Mabel>,
 
Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     help with SUBMIT syntax

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.