Button with javascript
I am trying to create a button that will call JavaScript function. Something like delete button - when user presses it he receives a JavaScript alert message. I am sure it could be done but I couldn't find it in documentation.
Robert, you can modify this function to your needs and include it in a .js file that is included in you page template. Do NOT modify /images/javascript/core.js or functions.js as these files will likely change with each upgrade, thus over-writing your changes.
function confirmIt(msg)
var confIt = msg;
if(confIt ==null)
confIt= confirm("Would you like to perform this action?");
else
confIt= confirm(msg);
if (confIt== true)
// The following line will set the value of request to "Confirmed",
// you can use any value you wish, then reference this value
// for conditional logic such as processes or branches
doSubmit('Confirmed');
}
Similar Messages
-
Button with Javascript appearance changed.
Hi,
I created button with javascript from
Re: Button and Function
Everything works fine, But button looks different now
No appearance of button is there & button label is displayed in orange color.
Have i missed something or i will never like original.I have done some changes suggested by ATD for another thread.
In your app, through Shared Components, Templates create a new button template based on a copy of an existing one (pick whichever existing template you prefer, the normal Button may be ok). When the new template is created, edit it. You should see something like the following in the "Template" setting:
a href="#LINK#" class="t12Button" #BUTTON_ATTRIBUTES#>#LABEL#</a
There may be other HTML around this, but this is the important part as it is the actual button itself. Change this to:
a href="#" class="t12Button" #BUTTON_ATTRIBUTES#>#LABEL#</a
Now, on your button on the page, change it to use your new button template. In the Button Attributes setting, add in:
onclick="javascript:checkText();"
everything works fine except appearance of button.
Edited by: TEJU on Jun 4, 2009 10:21 AM
Edited by: TEJU on Jun 4, 2009 10:22 AM
Edited by: TEJU on Jun 4, 2009 10:24 AM -
How to add a button with Javascript to Library
Hi
I am using Captivate 5.5 to create a template.
In the files which will be created using this template, we will be adding a button which executes a Javascript. Now, my question is, since this button will be used on multiple slides in the file, can I add this button (with the Javascript) to the library? Currently, we create it manually everytime.
We don't have a programmer in our team, so we can't create widget. Is there an alternative way?
Thanks for your help.
SreekanthThanks for that reply.
I now have a blank slide with the button (including the javascript) on it which solves the problem of importing it manually.
However, when we use this template to import PowerPoint presentations, when we publish the file, the first slide (the one on which I have this button) will be blank and has to be manually deleted.
Is there a way to eliminate this manual work? I tried hiding and using some actions. But it was not of any use. -
Html db confirmation button with javascript:
Hello,
First, I have a button with a URL javascript:confirmAction(document.forms[ wwv_flow ].elements[ P181_MESSAGE_CANCEL ].value, Cancel);
In this moment, by pressing on "CANCEL" button, a pop-up with the message of field (P181_MESSAGE_CANCEL) appears and there is a connection towards the same current page with the starting values. I want to make a validation, because if no field were modified, then I do not want whom the message posts by pressing on the "CANCEL" button but that the connection is carried out normally.
Second, I would like that if one modifies a field in a page and that while pressing on a mitre to move on another page, that it is a message in pop-up there "Want you to really change page without recording your modifications? "
Thank you very much!Do you mean a close button in HTMLDB or the browser window's close button? [HTMLDB cannot help much with the latter!]
For buttons you created, just add a URL target as
javascript:if(confirm("Are you sure?")) doSubmit('CLOSE');
That will popup the box and if OK is clicked submit the page with REQUEST set to CLOSE -
How can I hide a button with javascript in Captivate 8?
I need to run some javascript in my project and at the same time I want to hide a button, so I can't use advanced actions.
It is very strange, most users who have focus on JS try to do everything with it, whereas lot of simple actions can easily be done with advanced/shared actions. I will only go to JS when it is not possible with advanced/shared actions.
You are lucky, I was just restarting to work on an advanced training for next week when your question showed up. -
Captivate Buttons with JavaScript
At my place of employment, we use Adobe Captivate to create
demonstrational tutorials for our software system. We are currently
looking into adding a screen at the end of each of our tutorials
that includes buttons to either watch the tutorial again ("Watch
Again") or close the browser window ("Close This Screen")...
Through Captivate's buttons we can easily create the "Watch
Again" button by setting the button properties to...
- If the user clicks on the button...
--> On Success: Jump to Slide
----> Slide 1
However, I am having some difficulties with the "Close this
Screen" option. I currently have things set up so that the browser
window is closed through JavaScript, which works fine. This is
achieved through the following button properties settings...
- If the user clicks on the button...
--> On Success: Execute JavaScript
----> JavaScript:window.close();
The only problem I'm running into is that when I click the
"Close this Window" button in the published SWF file in an Internet
Explorer window, I receive an IE pop-up message that says...
"The webpage you are viewing is trying to close the window.
Do you want to close this window?", with Yes and No options.
If possible, I'd like to be able to bypass this message. Does
anyone have any clue as to whether this is possible, and if so, how
to do it through Captivate?
On another forum (
http://www.trap17.com/index.php/javascript-close-window_t29518.html),
it looks like I may have found a solution, but I'm not sure how to
format/translate the language so that Captivate can understand it
and execute without error. My attempts thus far have been
unsuccessful. Here is the code that I believe SHOULD work, which
calls out a pre-defined JavaScript function...
function NoConfirm ()
win = top;
win.opener = top;
win.close ();
JavaScript:NoConfirm();
As I've said; however, this gives an IE error message when I
run the output and the close function completely ceases to work.
Again, does anyone have any ideas...?
Thank you in advance.
--DanielOne of the problems is that IE/Windows will give you a
security warning when you try to close a browser window from
another object. The basic rule is, a command from JavaScript to
Javascript will close without a security warning. Therefore, you
must place the Javascript code - a function - out in your HTML
page. It just sits there - and then within Captivate - you call
that function - and it executes - without an error message :) Note
- the code below works flawlessly - but depending on your system -
i.e. in IE - you might receive a warning for running JavaScript.
You need to run it from a web server from a
http:// address to make this work 100% with no
user actions required.
Here's the code I use:
HTML Page (you can place this in your standard.htm file, so
that it's placed in your HTML pages each time you publish). This
code should be placed within the <head> </head> tags of
your html page (you can use Notepad to edit).
<!-- Javascript below called from Captivate to close the
browser window.
Code created by
http://www.kcwebplaza.com/captivate
-->
<script type="text/JavaScript">
<!--
if(window.parent!=window)
window.close = function()
window.parent.close();
//-->
</script>
Captivate Movie
In your Captivate button properties, select On Success >
Execute Javascript. Click the ... button, and place this inside the
dialog:
window.close()
Good luck!
Todd -
How to create a button with javascript
Hello everyone ,
I'm pretty new in the world fo APEX , after reading a lot of tutorials , i'm trying to build my own application ,but now i'm stuck because of my lack of knowledge :)
So here is the problem ,
I have a line with a select list ( designed to select a task )+ 5 text fields ( designed to write how many hours the worker worked each day for the task )
And then , a button " Add Task " , so with this button i want to create a copy of the first line so the worker can add an other task , but actually i have no idee how to do this .. I don't know if i was clear or not ? ,
I will apreciated all advice and remarks ,
Thanks in advance
BriceOnce your tabular form is created,
go to Report Attributes and click the edit icon(pencil image) next to the column you want to be a select list,
go to column attributes and click the Display As select list, and you'd probably choose Select List Static or Named
The Add Task button would be the standard 'Add Row' button that gets created from creation of the tabular form.
What do the rows that you want to create relate to? It seems that the first row has a Task coming from the select list and the 5 entry columns as hours each working day of week and one week = one row ?
If you need to create additional blank rows, I would look at using an Apex Collection, created in a before header process, where you can add as many rows as desired, then query the collection for the tabular form, and maybe have a custom post submit process to update the collection data to your table. If you're only adding rows to the table, you don't really need the checksum functionality that is a desirable part of the Apex Tabular Form/MRU process. Thinking out loud here.
Hope this helps.
Edited by: Bob37 on Nov 9, 2011 10:40 AM -
Radio button with javascript - - Please HeLP !
Hi,
I have the following code
My question is:-
Q : Clicking on Submit button. gives a javascript
message "Please make a selection" even though when I selected a radio button
I have haspmap which displays possible answers to a question in a radiobutton type. When submit is prssed, I like to check whether a selection is made or not. and if not, I want a message shown. And when selected. I want page to prcede to processSurveyInfo.do
Please help
<script language="javascript">
function checkRBtn()
var name = document.forms[getNetuiTagName("studentmultpChcform", this)][getNetuiTagName("rbtn", this)].value;
if ((name==null) || (name=="Undefined")) {
alert("Please make a selection");}
else {
document.forms[getNetuiTagName("studentmultpChcform", this)].method="POST";
document.forms[getNetuiTagName('studentmultpChcform', this)].action="<netui:rewriteURL URL="/TrainingActivity/Administration/SurveyFile/processSurveyInfo.do" />";
document.forms[getNetuiTagName("studentmultpChcform", this)].submit(); }
</script>
<table align="center">
<tr>
<td>
<netui:button value="Next-->" type="submit" styleClass="commonButtons" onClick="checkRBtn(); return false;" tagId="nq"/> </td>
<td>
<netui:button value="Finish" tagId="finbtn" action="fwdfinish"/> </td>
</tr>
</table>
<table align="center">
<tr>
<td>
<netui:button value="Next-->" type="submit" styleClass="commonButtons" onClick="checkRBtn(); return false;" tagId="nq"/> </td>
<td>
<netui:button value="Finish" tagId="finbtn" action="fwdfinish"/> </td>
</tr>
</table>
please help me out.
Thanks
-Raza-You need to write a custom script and it's location will depend upon when you want the script to execute.
Radio Buttons and Check Boxes have a string value of "Off" when none have been selected and take the value assigned to the field when checked. -
Printing PDF attachments with Javascript?
I am very new to Javascript (and not a programmer) so please excuse my basic or un-correct terminology here! I've created an interactive pdf, and have set buttons (with javascript code) to print specific ranges of pages from the document. I've now been asked to have said buttons print attachments (which are also pdf's) in the same style... is this possible, and if so, does anyone have example code? The code that I used to print the page ranges, for example:
print ({nStart: 0, nEnd: 5});
Any assistance/guidance/help would be greatly appreciated!The document first has to be opened. You can do this via JavaScript with the doc.openDataObject method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.509.html
This method returns a doc object, which you can use with the print method to print the document. You should then use the closeDoc method to close the document, as mentioned in and demonstrated in the documentation linked to above. -
Associating two events with submit button using javascript in jsp
Hi
How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up windowHave something like :
<input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky. -
Open and Close Popup With Javascript
Using Apex 3.2
I have probably done this loads of times in my old job, but do not have access to the code and today I just can't get it to work properly.
I have opened a pop up window with javascript
Now I need to close it and refresh the calling page, but only if it passes the validation on the popup.
I have a hidden item on my pop up called P7_FLAG.
I have a page process after validation that sets P7_FLAG to (only set to 1, if passes validation).
I also have a SUBMIT button.
So once I click my SUBMIT button the page should look at the validations, if ok, set P7_FLAG to 1, then close the popup and refresh the calling page.
My current javascript look like this
<script type="text/javascript">
function saveChanges(){
doSubmit('SUBMIT');
var test = $x('P7_FLAG').value;
if(test == '1')
window.close();
window.opener.doSubmit('REFRESH');
</script>On my button
javascript:saveChanges();The problem is that I need to click the SUBMIT button twice.
First time it sets P7_FLAG
Second time it closes page and refreshes.
I have probably made some basic error, but today I cannot see it.
Cheers
Gus
Edited by: Gus C on May 10, 2012 12:48 AM<script type="text/javascript">
function saveChanges(){
doSubmit('SUBMIT');
var test = $x('P7_FLAG').value;
if(test == '1')
window.close();
window.opener.doSubmit('REFRESH');
</script>javascript does not wait for the current action to complete and then perform the next line.
means in your function call
doSubmit('SUBMIT');is triggered and it carry on's to next line that is
$x('P7_FLAG').value;this will not be set because you are setting the value of P7_FLAG to 1 in plsql and trying to check in javascript, which will not work.
what you need to do is amend your js function like below
<script type="text/javascript">
function saveChanges(){
doSubmit('SUBMIT');
</script>create a page branch to procedure and make it conditional to when P7_FLAG = 1
and set the branch source to below
htp.p('window.close();');
htp.p('window.opener.doSubmit(''REFRESH'');'); -
Problem with Javascript and opening a new page
Hi,
I'm developping a website with Java Server Faces.
I've a problem with JavaScript.
I have a table, and each row of that table, has a button, to display more information about that specific row. I want to display this information in a new window. For this I want to use JavaScript.
The new window, of course, needs some information of the other window, to show the right data.
The first time I click the 'more-information-button', it works perfectly, but from than on, he keeps showing the same information...
Here is my jsp-page of the first page (the one with the table):
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<f:loadBundle basename="languages.MessageBundle" var="bundle"/>
<html>
<head>
<meta content="no-cache" http-equiv="Cache-Control"/>
<meta content="no-cache" http-equiv="Pragma"/>
<title>- UCV-Period -</title>
<link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body style="-rave-layout: grid">
<h:dataTable binding="#{UcvPeriod.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd" rows="5"
style="left: 24px; top: 168px; position: absolute" value="#{UcvPeriod.dataTable1Model}" var="currentRow">
<h:column binding="#{UcvPeriod.column1}" id="column1">
<h:outputText binding="#{UcvPeriod.outputUcvPeriod}" id="outputUcvPeriod" value="#{currentRow['UCVPERIOD']}"/>
<f:facet name="header">
<h:outputText binding="#{UcvPeriod.outputText2}" id="outputText2" value="#{bundle.ucvPeriod_columnHeader_ucvPeriod}"/>
</f:facet>
</h:column>
<h:column binding="#{UcvPeriod.column11}" id="column11">
<h:commandButton action="#{UcvPeriod.btnDetails_action}" binding="#{UcvPeriod.btnDetails}" id="btnDetails" value="+" onclick="window.open('Details.jsp')"/>
<f:facet name="header">
<h:outputText binding="#{UcvPeriod.outputText21}" id="outputText21" value=""/>
</f:facet>
</h:column>
</h:dataTable>
</h:form>
</body>
</html>
</f:view>
</jsp:root>Here is my action, when someone clicks on the 'more-information-button':
public String bthnDetails_action() {
Object s = outputUcvPeriod.getValue();
BigDecimal ucvPeriod = (BigDecimal)outputUcvPeriod.getValue();
this.getSessionBean().setUcvPeriod(new Integer(ucvPeriod.intValue());
return "detail_ucvperiod";
}Here is my constructor of the Detailspage.
public Details() {
this.txtUcvPeriod.setValue(this.getSessionBean().getUcvPeriod());
}Here is the navigation part for this part of my faces-config.xml .
<navigation-rule>
<from-view-id>/UcvPeriod.jsp</from-view-id>
<navigation-case>
<from-outcome>detail_ucvperiod</from-outcome>
<to-view-id>/UcvPeriod.jsp</to-view-id>
</navigation-case>
</navigation-rule>Thx a lot....
AnnekeSee the tutorial "Sharing Data Between Two Pages" at http://devservices.sun.com/premium/jscreator/standard/learning/tutorials/data_sharing_twopages.html and the FAQ "How can I pass data between pages without creating SessionBean variables in Creator?" at http://devservices.sun.com/premium/jscreator/standard/reference/faqs/technical/javasource/passing_data.html. Since you can open a new window when your button is clicked, the tutorial and FAQ will explain ways to pass your data to the new window.
-
Web.show_document() with javascript
Hi Guys,
I'v been searched this forum about web.show_document() with javascript.
I saw some threads said
I can do like
WEB.SHOW_DOCUMENT ('javascript:window.open("http://www.google.com","","fullscreen=no,titlebar=no,location=no,toolbar=no,menubar=no,status=no,resizable=yes");self.close()','_blank');
and someone said it worked, but it doesn't work in my machine.
also some one said the javascript engine is not included in Form 10.1.2, so I can not use WEB.SHOW_DOCUMENT function like above.
My form builder is 10.1.2.0.2 (Production), os is xp sq2 ,ie 6.(ie6 has some tighter security)
I want to get clarification about this function, can i use the javascript on it or not ? I really want the pop up window without toolbar and customize size. I need do some configuration in formweb.cfg also?
Thanks in advance. I appreciated every response.
AppcatHi Jan,
Thanks for your reply. I check the metalink about it.
The first solution is
1. Make forms Developer URL a trusted site in IE to allow script executions.
For that open Internet Explorer->Internet Option-> Security.
Select the "Trusted Sites" Option.
Click on the Sites Button.
Add the Developer Suite URL in that.
for example
http://<Yourmachinename>:8889/
It doesn't work in my machine ,still can not activate the javascript.
The second solution is
2. Place the script invocation code in a html file in Oracle_home/forms/server directory and call it.
For example :
Create a simple form.
In Forms Trigger :
web.show_document('http://<Yourmachinename>:8889/file.html');
In the file.html you may enter the code, for example:
<HTML>
<HEAD>Heading</HEAD>
<BODY>
<SCRIPT LANGUAGE="Javascript">
window.open("http://www.yahoo.com","_self");
</SCRIPT>
</BODY>
</HTML>
It also doesn't work in my machine, the problem is http://<Yourmachinename>:8889/file.html can not be found, even i put it under the Oracle_home/forms/server folder, but i click it directly ,the javascript works. that means the URL http://<Yourmachinename>:8889/file.html is incorrect or I should put the html file into other directory. And I also checked the default.env,FORMS_PATH=D:\DevSuiteHome\forms.
anything wrong with my env?
Do you have any idea about it?
Thanks,
Appcat
Message was edited by:
user577805
Message was edited by:
user577805 -
Printing different URL with javascript
I am trying to print a URL using javascript but i do not want to print the current page. I have searched google, this forum and a javascript book and can not seem to figure it out. To exlplain in it generic terms i want to be on one page and tell it to print another. Reason being, I am looking at an overview page and want to print a report made in Oracle reports, (Yes I could load the report and print it but i want to print multiple reports from one button)(The reports do work and are valid) Here is a rundown of what I am doing.
From a button i am calling a 'url' with the following code:
javascript:V_PRINT('P50_CUSTOMER_ID','P50_YEAR');
And then in the html header i have the code: (printing same page twice, just an example)
<script language="JavaScript" type="text/javascript">
function V_PRINT (formItem1,formItem2) {
var formVal1 = document.getElementById(formItem1).value;
var formVal2 = document.getElementById(formItem2).value;
var url1;
var url2;
url1 = 'http://www.google.com/search?hl=en&q=' + formVal1 + '+' + formVal2;
url2 = 'http://www.google.com/search?hl=en&q=' + formVal1 + '+' + formVal2;
url1 = print();
url2 = print();
</script>
This code just prints the current page. I know I am calling print incorrectly and thats where i need the help. Of course I might just be approaching it all wrong. Either way I hope someone with javascript knowledge can help.
ThanksHello,
To print a page it has to be open in the browser since all it does it call the browsers print dialog.
Here is one solution http://www.irt.org/script/508.htm and you can also try a iframe instead of a regular frame.
If it's crossdomain request like your example here that might cause problems as well. There might be additional problems.
Carl -
How to differentiate between Radio Buttons with the same name?
My form has two fields, to which I gave the same name ("Radio Button 1.0") in order to achieve mutual exclusivity.
Now, I would like to use JavaScript to retrieve the value of one the two fields:
var checkMark = this.getField("Radio Button1.0");
if (checkMark.value == "Yes") {
Questions:
What is the proper way to inspect the value of a Radio Button? I have tried this:
if (checkMark.value == "No") [...]
but it doesn't seem to work.
How can I tell apart 2 radio buttons with the same name?
TIA,
-RFHWhen Radio Buttons and Check Boxes are unchecked their value is "Off", so if you have "Yes", "No" buttons you will also encounter an 'Off" value. Now if you want to look at a given button, you will have to use the "isBoxChecked(nWidget)" method.
nWidget:
The 0-based index of an individual radiobutton or checkbox widget for this field. The index is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order).
Every entry in the Fields panel has a suffix giving this index, for example MyField #0.
Returns
true if the specified widget is currently checked, false otherwise.
Example
var f = this.getField("ChkBox");
if(f.isBoxChecked(0))
app.alert("The Box is Checked");
else
app.alert("The Box is not Checked");
Maybe you are looking for
-
Help. My Ipad will not respond, the screen has stopped working and I cannot turn it off
-
Does Setup Assistant delete files on the new mac?
I just got a new Macbook Pro, and I'm trying to decide how to transfer all of my files from my old computer to my new one. The problem is that I'm a little paranoid about losing any files on the new computer. I once accidentally wiped my entire syste
-
Dear Friends I created a T code for CJE0 report. ( with client program names) It works by my problems are. 1.when i run through CJE0 directly output comes with only summary details but when i run with Tcode output comes with detail breakdown, i want
-
Iten category of purchasing document
Hi all Plz tell any one where the Item category L will store in purchase order document type in subcontracting process.. thanks ramesh reddy
-
24 bit audio not playing in Quicktime
I have captured some video through an a Matrox MXO2 in Adobe Premiere CS6 and end up with 24 bit PCM audio in my .mov files that can't be played back in Quicktime player or any other Quicktime based application. This happens regardless of the codec