Change the value of the radio button using Java Script
Hi I have a radio button "Process_mode" with two 'ONLINE' and 'Offline' values.based on the selection criteria, I will call the process_mode() function and if the user presses the ok button I want to change the proces_mode offline.
Here's my java script.
but it does not change the value of the variable.
Please suggest how to proceed.
function process_mode()
{
confirm_msg = confirm ("your search criteria is complex.") It is proposed to submit the application in offline mode. do you want offline? ») ;
If (confirm_msg is true)
{
$x('p2_process_mode').value = "out of the CONNECTION";
$x('P2_HIDDEN_PROCESS_MODE').value = "offline";
}
}
doSubmit ('BTN_FINAL_COUNT');
Alert ("your application has been submitted. Please wait until the system processes your request.') ;
Thanks and greetings
Ashok Salimath
Published by: user644340 on July 19, 2009 23:11
Hey Ashok,
A Radio element generates actually individual boxes within a radiogroup (this is done by giving the same "name" attribute to each key). Each button has its own attribute 'ID', which will be the name of the option page more "_n" - where n is a number from 0 (zero) - so the first button will be, say, "P1_RADIO_0", then the second will be "P1_RADIO_1" and so on.
To set the value of the radiogroup and, therefore, article, you need to 'check' one of the buttons - this is done by setting its 'checked' true value. For example, if "Offline" is the second radio button to the P2_PROCESS_MODE element:
$x('P2_PROCESS_MODE_1').checked = true;
Andy
Tags: Database
Similar Questions
-
Change the shared user using Java API Service
Hi Experts,
I have successfully run the example of classes Java from here: http://docs.oracle.com/cd/E17236_01/epm.1112/epm_security_api/frameset.htm?ch01s03.html
And I need to change the code of UserFunctions.Java.
UserFunctions.Java, I can create, edit, and delete a user.
But in this sample program, when I want to edit a user, I should create a new user first.
My requirement is I want to change the existing user passing the parameter when you run the program.
So, when I want to launch the program, it should be like this:
Java UserFunctions 'method' 'username', 'password', 'email', 'first name', 'last name '.
FYI, I can create a user in passing the parameter as I mentioned above.
But to edit a user, I still can't do it.
Please find my codes below:
public CSSNativeUserIF createUser (String username, String desc, String firstname, String lastname, String email, String pass) throws CSSException
{
The user CSSNativeUserIF = null;
HashMap context = new HashMap();
user = cssDMAPI.getNativeUserInstance (context, main);
user.setLoginName (username);
user.setDescription (desc);
user.setFirstName (firstname);
user.setLastName (lastname);
user.setEmailAddress (email);
user.setPassword (pass);
cssDMAPI.addNativeUser (main user, context);
return the user;
}
' public void modifyUser (String username, String desc, String firstname, String lastname, String email, String pass) throws CSSException
{
The user CSSNativeUserIF = null;
HashMap context = new HashMap();
System.out.println ("Edit description user...");
user = cssDMAPI.getNativeUserInstance (context, main);
user.setLoginName (username);
user.setDescription (desc);
user.setFirstName (firstname);
user.setLastName (lastname);
user.setEmailAddress (email);
user.setPassword (pass);
cssDMAPI.updateNativeUser (main user, context);
}
-------
in the Sub main():
If (method.equals ("create"))
{
/ * Create a native user * /.
cu.printMsg (System.out, "- creating a user-" "");
user = cu.createUser (username, desc, firstname, lastname, email, pass);
cu.dumpUsers (System.out, "the user is created successfully," new CSSNativeUserIF [] {user});
}
ElseIf (method.equals ("update"))
{
/ * Change native user * /.
cu.printMsg (System.out, "- update a user-");
cu.modifyUser (user name, desc, firstname, lastname, email, pass);
cu.dumpUsers (System.out, "the user is updated", new CSSNativeUserIF [] {user});
}
Could you please help me with this?
Thank you and best regards,
ChristopheTry this
CSSUserIF [] usrs to = cssAPI.getUsers (context, principal, sLoginName);
If (usrs.length > 0) {}
CSSNativeUserIF natUser1 = (CSSNativeUserIF) usrs to [0];
natUser1.setLoginName (sLoginName);
natUser1.setFirstName (sFirstName);
natUser1.setLastName (sLastName);
natUser1.setEmailAddress (sEmail);
natUser1.setDescription (sDescription);
natUser1.setPassword (sPassword);cssDMAPI.updateNativeUser (context, principal, natUser1);
} -
Problem to find the Position of the cursor by using Java Script for an input TextField
Hello
I have a problem to find the position of the cursor in a field inputText component.
The following code of java script to achieve. The same functionality works fine if I run in a simple html page. But when it is used the same javascript inside the jsff does not the position of the cursor.
Please let me know what I'm missing.var adfComponent = AdfPage.PAGE.findComponentByAbsoluteId("r1:1:it3"); var adfComponentClientId = adfComponent.getClientId(); var div = document.getElementById(adfComponentClientId + '::content'); div.focus(); var docSelectionRange = document.selection.createRange(); docSelectionRange.moveStart ('character', -div.value.length); var iCaretPos = docSelectionRange.text.length; alert("iCaretPos --> "+iCaretPos); ---> This statement always returning '0'. Instead, i want the cursor position inside the text box.
For your reference, sending the sample page html that works fine with the same kind of code.
Thank you and best regards,<html> <body style="font-family: tahoma; font-size: 8pt;"> <script language="JavaScript"> /* ** Returns the caret (cursor) position of the specified text field. ** Return value range is 0-oField.length. */ function doGetCaretPosition (oField) { var iCaretPos = 0; alert(oField); if (document.selection) { // Set focus on the element oField.focus (); // To get cursor position, get empty selection range var oSel = document.selection.createRange (); // Move selection start to 0 position oSel.moveStart ('character', -oField.value.length); // The caret position is selection length iCaretPos = oSel.text.length; } // Firefox support else if (oField.selectionStart || oField.selectionStart == '0') iCaretPos = oField.selectionStart; // Return results return (iCaretPos); } </script> <form name="blah"> Text Field: <input type="text" name="nameEdit" value=""> <input type="button" value="Get Caret" onClick="document.getElementById('where').value=doGetCaretPosition (document.forms[0].elements[0]);"> <input id="where"> </form> </body> </html>
Kiran kristelle
Published by: Kiran kristelle on February 6, 2012 12:00... had the chance to look at the source code of the sample. ADF Faces renders text as HTMLTextArea fields when the value of the rows property. The JavaScript code used in the example of client works differently for FF and IE if the input is a text box. This could be a problem in IE or just used JavaScript code. The rows back to a single line (remove) property makes the text as HTML input feldworking with the JavaScript for IE and FF.
Frank
-
Show/hide buttons using java script...
I would use a list box to select the buttons are visible. I found the following on another page script and tried to make it work for my
situationif ((getfield(class_select").value =="10th Grade English")
{
getField("competency_10").display = display.visible;
GetField ("objective 10"). Display = display.visible;
}
on the other
getField("competency_10").display = display.hidden
getField("objective_10").display = display.hidden
I nominated the list box "select class" and I have 2 sets of buttons, a set of skills and a set of objectives.
I get an error message. Basically I would like that this too happen. When I select 10th grade English in the skills/goal list for 10 grade English buttons become visible. When I select English grade 8 the jurisdiction/goal for the grade 8 English buttons become visible. I use a button with the pop-up window to populate a text field. I created buttons 8th grade and grade 10 and I would not have only one I need visible when I need it. I was going to fix the buttons on top of the other and allow the use of the same text box when it is visible. If there is another way to do it I am open to suggestions, but it seemed easier to just make my buttons visible/hidden. I don't know that I've screwed something I do not know what
OK, thanks for the clarification. If you set the drop-down list box "select value Commit immediately" on the Options tab, it should behave as you wish.
-
How to disable a button using Java Script in Apex
Hi all
I tried to disable a button when the value of an element of the selection in the same page list is zero. Here are the steps that I did.
(1) created a new model of button like < table class = "t9StandardButton" id = "" #BUTTON_ID # "cellspacing ="0"cellpadding ="0"border ="0"Summary =" ">"
2) has changed the model of existing button to the newly created button model.
(3) added onchange = "javascript:fdisplay (this); "the selection list form element value
(4) added the following in the page header java script
< script type = "text/javascript" >
function fdisplay (some) {}
If {(some.value == 0)
html_GetElement (' #BUTTON_ID # "") .disabled = true;
}
on the other
{
html_GetElement (' #BUTTON_ID # "") .disabled = false;
}
}
< /script >
But the script does not work. Is there something I'm missing here. Please advice.
Thank you
VikasVikas:
In the field "attributes button" button type "id ="Ceboutonsélectionnel".
Edit the button template to include the #BUTTON_ATTRIBUTES substitution string #. This should be put in the anchor tag in the template definition.
Change your Javascript to reference the ID above as.... html_GetElement ('thisButton').disabled = true; ....
CITY
-
The parameters section passes from one form to another form (using java script)
Hello
IAM two forms as A and B
in my form of results of research/B that allows to display the results on the basis.
If I call this shape A it should take the values of A and proceed to page B and run the query.
I have my VO as
Select * from cust_ont_order_details where ORDER_ITEM =: 1;
And I wrote a method called 'initQuery' and the execution of this method as a result and Iam passing here bind values.
' Public Sub SearchParams (pageContext OAPageContext, OAWebBean webBean)
{
CustAttFindASpareViewVOImpl vo = getCustAttFindASpareViewVO1();
String ItemId = "";
If (pageContext.getParameter ("ItemId")! = null & &! pageContext.getParameter("ItemId").equals(""))
{
System.out.println("0001");
StateSearch = pageContext.getParameter("ItemId").toString ();
vo.setWhereClauseParam(0,ItemId);
}
on the other
{
vo.setWhereClauseParam(0,null);
}
}
This works very well if am looking for page B, how can I pass values to a?
IAM using Java script to open the B of a form.Mahesh
If the two are OA pages have your tried using the pageContext.putSessionValue method.
Thank you
AJ -
Hello
In my form, I want the radio button.
On the selection of this radio button user can change the status of "QC" for "STOCK".
Initially, when he disabled status should be "QC".
How to put this in my form guide me please.
MauryMake a group of Radio (say RADIO_GROUP16) with 2 buttons radio (mean RADIO_BUTTON17 and RADIO_BUTTON18).
Specify the initial value of Radio group to U
Specify the value of Radio to R and U buttonsand in the status field to write after outbreak.
If: block. RADIO_GROUP16 = 'U' then
message ("can not update status '");
raise FORM_TRIGGER_FAILURE;
end if;I guess that when you select the second radio button (with the 'R' value) then only you would be allowed to change the status.
Please check the answer correct/useful if th answer was helpful
-
How to dynamically set the filter IR APEX of the value of a radio button column?
Hello
I built a simple APEX 4.2 IR report that includes column, namely "Source_Data" and a separate user to input radio button namly "P33_SOURCE_DATA" with two possible values in 'X' or 'Y '.
I would like the report filter source_data = 'X' or source_data = "Y" is applied, after each time the user clicks on the radio button P33_SOURCE_DATA. "
So my question is, how to set the value of the IR filter using the value of P33_SOURCE_DATA to the dynamic action and javascript?
Thanks in advance.
Concerning
Susanna
In this case, you can pull an onchange dynamic action on the radio, or at the click of a button.
This dynamic action update your IR region
And your IR region would have an appropriate where clause, with "Page to go" set on your radio.
-
How to get the display of the radio button value
Hi I have a situation where I need to display the value of the radio button, for example I store A value in db, but I view Active in my radio button how do I do
my radio button is
< af:selectOneRadio id = "sor3" layout = "horizontal".
value = "#{pageFlowScope.InternalBean.Status} '"
autoSubmit = 'true '.
valueChangeListener = "#{RadiobuttonPopupBean.activationChangedListener}" >
< af:selectItem label = 'Active' value = 'A' id = "si10" / >
< af:selectItem label = 'Inactive' value = 'I' id = "si9" / >
< / af:selectOneRadio >
I have what it takes to display the value in the outputtext
< af:outputText value = "reason: #{bindings." Reason.inputValue}"id ="ot9 ".
partialTriggers = "d1" inlineStyle = "height: 100px;" / >
am in jdeveloper 11.1.1.6.0
I've updated the ticket to show how to do this. You can find the blog at http://wp.me/pcBZk-ye
Please download the workspace updated using the link to the blog post.
Timo
-
How to change the color of the radio buttons on question slides
Hello
Can I change the color of the radio buttons (right now it is blue) on question slides?
Thank you very much!
Not out of the box and only for HTML output. Search for assets HTML option button is there. If replace you it with a custom chart... Here's the path on my system (I'm on Win 7)
C:\Program Files\Adobe\Adobe Captivate 9 x64\HTML\assets\htmlimages
-
How to show or hide the region of the shuttle during the click on the radio buttons?
Hello
I'm new to JDeveloper. Here is my requirement.
1. create 2 radio buttons: Yes and no and default displays "" selected radio button.
2. create a region of shuttle with select query in VO.
Query is:
Select 'No group' for_user, for_pkg double null
Union
Select "Company" for_user, for_pkg "SEGMENT1" double
Union
Select 'Rental' for_user, for_pkg 'SEGMENT2"double
Union
Select 'Cost center' for_user, 'SEGMENT4' double for_pkg
Union
Select 'Project' for_user, 'SEGMENT5' double for_pkg
Union
Select "Intercompany" for_user, "SEGMENT8" for_pkg of the double
order by nulls first for_pkg
3. initially hide the region of the shuttle during the loading of the page.
4. click on the radio button 'yes', display area of the shuttle with values at the head of list of query VO and empty list leak.
5. new click on the 'no' radio button, he must hide region and so screen shuttle shuttle dynamically according to the selected option button.
But my problem is I am able to hide area shuttle when the page loads at the beginning and after that, when I'm clicking 'Yes' radio button, is just to display area shuttle empty without value in the main list and once when I'm clicking 'No' radio button, it should hide area shuttle but he's not hiding. I used the RPP to show or hide the area Shuttle under certain conditions. I use JDev 10.1.3.3.0 version as we Oracle EBS version 12.1.2 in our society.
Please find the attached draft and suggest me proper with examples of sample approach.
Monika,
I tried to get this working in the lower version of Jdeveloper and looks like it works.
Can you make the change below and see what happens.
1. modify your query to VO as below: (I replaced null with SEGMENT0)
select 'No Grouping' for_user, 'SEGMENT0' for_pkg from dual union select 'Company' for_user, 'SEGMENT1' for_pkg from dual union select 'Location' for_user, 'SEGMENT2' for_pkg from dual union select 'Cost Center' for_user, 'SEGMENT4' for_pkg from dual union select 'Project' for_user, 'SEGMENT5' for_pkg from dual union select 'Intercompany' for_user,'SEGMENT8' for_pkg from dual order by for_pkg
2. place VO execution to the processFormRequest:
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { System.out.println("In process Form Request"); super.processFormRequest(pageContext, webBean); OAApplicationModuleImpl appModule = (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean); String eventParam = pageContext.getParameter(EVENT_PARAM); System.out.println("eventParam: " + eventParam); if ("showHideShuttle".equals(eventParam)) { // appModule.invokeMethod("deletetrailing"); System.out.println("Inside If"); OAMessageCheckBoxBean messageCheckBoxBean = (OAMessageCheckBoxBean)webBean.findChildRecursive("checkBoxBean"); System.out.println("messageCheckBoxBean : " + messageCheckBoxBean); String messageCheckBoxBeanVal = (String)messageCheckBoxBean.getValue(pageContext); System.out.println("messageCheckBoxBeanVal: " + messageCheckBoxBeanVal); if ("Y".equals(messageCheckBoxBeanVal)) { OAViewObjectImpl shuttleVO1 = (OAViewObjectImpl)appModule.findViewObject("ShuttleVO1"); if (shuttleVO1 != null) { shuttleVO1.setWhereClause(null); shuttleVO1.setWhereClauseParams(null); shuttleVO1.executeQuery(); System.out.println("Executed Query : " + shuttleVO1.getQuery()); } OAViewObjectImpl shuttleVO2 = (OAViewObjectImpl)appModule.findViewObject("ShuttleVO2"); if (shuttleVO2 != null) { shuttleVO2.setWhereClause("1=2"); shuttleVO2.setWhereClauseParams(null); shuttleVO2.executeQuery(); System.out.println("Executed Query1 : " + shuttleVO2.getQuery()); } } String[] name = { "RenderAttr1" }; String[] val = { messageCheckBoxBeanVal }; Serializable[] params = { name, val }; Class[] paramTypes = { String[].class, String[].class }; appModule.invokeMethod("setXXCustomPVOValues", params, paramTypes); } }
3. move Spel link shuttle Bean for the region of header above.
Some useful links for the shuttle Bean:
Technology blog based in Java of Sushant: 13. Area of application OFA shuttle
Framework OA Blog: control of the shuttle as part of OSTEOARTHRITIS
See you soon
AJ
-
Average of the radio button selections, but exclude the equation 0
This should be simple. I've seen a lot of posts which should have led me to a Twitter.com response, but I still have trouble.
Here we go:
(1) I have 9 groups of radio buttons named: GMR1. 1_Score; GMR1. 2_Score; GMR1. 3_Score; GMR1. _Score 4; GMR1. 5_Score; GMR1. 6_Score; GMR1. 7_Score; GMR1. 8_Score; GMR1. 9_Score
(2) each group of option buttons buttons 4 with the same values in each group:
- "NA" where I put the Radio button choices under the Options tab = 0
- "Fair" where I put the button choice Radio under the Options tab = 1
- 'Good' where I put the Radio button choices under the Options tab = 2
- 'Great' where I put the Radio button choices under the Options tab = 3
Thus, the shape looks like a little at:
GMR1. 1_Score
- NA
- Just
- Good
- Large
GMR1. 2_Score
- NA
- Just
- Good
- Large
and so on. The user chooses a 1 option for each question.
My goal is to get an average that excludes the selections of NA. Compared with this average, I want to assign the specific text to appear.
If I did it in 2 steps in excel, my formulas could look like:
C7 = SUM (range) / COUNTIF (range, "> 0")
= IF (C7 < 2, "overall score is fair, IF (C7 < 3, 'Overall rating is good', IF (C7 > = 3,"overall score is great!")))
I think to that the following should work to count all selections does not match "NA" by excluding getField ("GMR1." + i + "_Score") .value == 0 a counter like the one below, but it is not!
(The here's how I'm playing the part of the excel formula COUNTIF)
****************************
var counter = 0;
for (i = 0; i < = 9; i ++)
{
If (getField ("GMR1." + i + "_Score") .value == 1) counter ++;
If (getField ("GMR1." + i + "_Score") .value == 2) count ++;
If (getField ("GMR1." + i + "_Score") .value == 3) counter ++;
}
If (counter > 0) {}
Event.Value = counter;
} else event.value = "";
****************************
The Sum (range) is simple enough using the "value is the sum "on the calculation of the properties of the text box tab.» But if I wanted, it's all happening in a block of code, then that won't work for me.
****************************
The assignment of text based on the value average; I haven't got there yet.
****************************
Help, please. There must be a way to do all this in a fairly simple code that is simply eluding me.
See if to change this instructs the following assistance:
for (i = 1; i< 10;="" i++)="">
It should have been an error in the JavaScript (Ctrl + J) console which provides clues as to what is wrong.
-
How to customize the height between the two options of the Radio button control component?
Hi all
Please help me.
I want to reduce the height of two radio button options. I change the Radio band height & width but between two option has not changed.
I try this code below in qml
RadioGroup {}
ID: radiogroup
layoutProperties: {AbsoluteLayoutProperties}
positionY: 375.0
positionX: 600,0
}
preferredWidth: 100.0
preferredHeight: 440,0
maxHeight: 440,0
minHeight: 440,0
Option {id: stc; text: ' '; selected: true}
Option {id: mobily; text: ""}
Option {id: zain; text: ""}
Option {id: blackberry; text: ""}
}Please help me
I solved this problem using scale Propertie of the RadioGroup.
Thanks for your comments.
-
Deactivation / activation of the Radio buttons
Hi all
I develop application in Oracle Application Express 5.0.0.00.31.
In my page, I created a tabular form by using the query
SELECT
"ROWID",.
'EMPNO ',.
'ENAME ',.
'STATUS ',.
"ACCEPT."
FROM "EMP".
STATUS and ACCEPT two columns are type of radio button with a static query as
STATUS: STATIC2: new; N, entitled; A, completed; D
ACCEPT: STATIC2: accept; F, rework; R
My requirement is
1. When STATUS =has ' this time then ACCEPT column boxes must be activated. (I)
2. another in('N','A') of STATUS then ACCEPT column buttons Radio must be turned off
Note: Later I hide status column. Accept that column must be specified. Based on the value of the STATE Accept column column
Radio buttons work
I put my sample application in
https://Apex.Oracle.com/pls/Apex/f?p=28020
workspace: myspace77
user: comments
password: apex_demo
-What someone will help me in this regard?
Thanks in advance.
Kind regards
Colette
Hi Colette.
Check your Application-> Page 1 28020. I've implemented the toggle the radio button.
Here are the steps to accomplish the toggling the buttons in table form:
- Added STATUS column with alias STATUSD in the form of your table.
- Added real action "Run the Code JavaScript" in your dynamic action "updating of the form: turn radio buttons:
Action: Run the JavaScript Code
Fire on loading the Page: Yes
Code:
$('th#STATUSD').hide(); $('td[headers="STATUSD"]').hide(); $('td[headers="STATUSD"]').each(function() { var row_val = $(this).text(); var row = $(this).closest('tr'); if (row_val == 'N' || row_val == 'A') { row.find('td[headers="ACCEPT"] input[type="radio"]').attr("disabled", true); } else { row.find('td[headers="ACCEPT"] input[type="radio"]').removeAttr("disabled"); } });
Assigned items: no
Kind regards
Kiran
-
Text in the radio button field triggers?
I'm sure it is a simple and I just have a moment on Monday, but I can't seem to find it by searching on the forum...
I have created a pdf form and I want an option button to automatically check when someone types the text in a certain area - how can I do this?
I would be put in place so that none of the fields in each section can be filled-in unless one of the radio buttons is selected. If space fields are displayed if this option button is selected and the same thing with the hull of the Pre-Built program fields. You can do it in show/hide fields, and you would also want to reset the fields when they are shown/hidden. Coding can be greatly simplified if you use a field hierarchical naming system for the two groups. For example, fso.width, fso.depth, fso.area, fso.a$, etc. and pss.width, pss, depth, etc.
You can then hide all fields selection of pre-designed Shell Scheme programs and reset and display all the fields only area and reset them with the following:
Hide all fields selection of pre-designed Shell Scheme programs and reset the
getField("pss").display = display.hidden;
resetForm (["SSP"];
Hide all fields only space floor and to reset
getField("fso").display = display.visible;
resetForm (["Fos"];
This is not complete, but should help you get started. Note that you can set up A$ fields so that they are automatically calculated according to the value of the Total m2 field, so that the user doesn't have to come in and maybe make a mistake. You can also configure the computed fields to display a value only if the width and depth fields are completed.
Maybe you are looking for
-
Thunderbird does not download or send emails after you migrate
I've migrated to a new computer by using the method to copy the contents of the profiles folder in the new thunderbird profile. It recognizes my account and shows all the mails and folders, but it does not download or send emails. The pop3 and smtp e
-
Some Brazilian certificates are not accepted by Firefox
Some certificates from the Brazilian Government sites are not accepted by Firefox
-
Satellite A100 PSAA8E - no sound on Windows XP
My Toshiba A100 (PSAA8E) initially provided with Windows XPI it have been upgraded to Vista with the option express upgrade. Some of my basic software were not supported so I reinstalled Windows XP Professional with Service Pack 2.After a lot of rese
-
Hello! Guys, I am having trouble with my antivirus (Kaspersky) and my sytem. There is a warning that says: Kaspersky Anti-virus statement its status Windows Security Center in a format that is no longer supported. I was wandering just if any of
-
Impossible to go to msn on computer
All of a sudden I can't pull up of msn. When I try the icon of internet explore address bar past to bing and msn displays, just a blank page