Question of values-Javascript form.

Hello

I use this javascript to disable some form values based on other form values:

< script language = "JavaScript" type = "text/javascript" >
function test() {}

Test1 var = html_SelectValue ('P2_A1') == 'Y ';
html_disableItem ('P2_A2', lCheck);
html_disableItem ('P2_A3', lCheck);
html_disableItem ('P2_A4', lCheck);
html_disableItem ('P2_A5', lCheck);
}

< /script >
OnLoad = "test()";

OnChange = test().
It works very well. When I select P2_A1 y it disables all other fields (all fields are selection lists)

When I am trying this javascript:

< script language = "JavaScript" type = "text/javascript" >
function race_Allowed() {}
Checks to P2_A1 (any P2_A1 does not
to Indicator2) and turns off P2_A2
var Lcheck = html_SelectValue ('P2_HISPANIC_INDICATOR') == 'Y' or ' don't;
html_disableItem ('P2_RACE1', lCheck);
html_disableItem ('P2_RACE2', lCheck);
html_disableItem ('P2_ETHNICITY1', lCheck);
html_disableItem ('P2_ETHNICITY2', lCheck);
}

< /script >

It does not work...

I know that I am using an operator 'or' in the wrong way. Can someone help me in how to do it. ? I want P2_A1 to Y or N then she disalbes all other fields.

Thank you

Hey,.

See how you have several conditions you use an if statement with a logical OR operation. A logical OR operation is represented by | (double pipe) in javascript.


I hope this helps.
Tyson

Tags: Database

Similar Questions

  • Using a value of form field to add it to a group of Contact treatment step

    Hey guys,.

    I followed the instructions on the post of Heather trigger several actions with an email clicks (via 'send blind form') and everything works great except for one thing. One of my processing steps must be added to the Contact Group, and I want to use a form as the value for this field. I have a created contact group called testContactGroup and I get this exact text as the value field in the query instructions string, but unfortunately, no matter how I try, this step gets ignored. The only time it running is if I use a coded value in hard, constant. Here's the URL that I use:

    http://now.Eloqua.com/e/F2.aspx?elqFormName=GDCGenericBlindForm & elqSiteID = 927 & MP = myTestMarketingProgram & CG = testContactGroup & e = < span class = "eloquaemail" > </span > EmailAddress & url = http://www.McAfee.com/

    As I said, everything else works. I have set up processing steps for updating the registration of contact and then redirect the user to a URL - while using the values of form sent to the query string field. Only adding to the Contact Group does not work. I can only imagine that it's looking for something other than the name of the contact group. I'm not sure.

    The cool thing about Heather here process is that you can use this a blind form to treat a great many different campaigns, but if I hardcode the Contact Group in the area add to the stage of processing of Contact Group, re-use of this form goes out the window.

    Has anyone met cela and if yes, do you have a solution?

    I met the same problem with the stage of email send where the e-mail name in a form never worked field.

    I used the ID of EmailDefinition, in the same way in your case, you will need to enter the ID of the Contact Group. To get the take ID your mouse on the name of the Contact Group when displayed in the recent items, you will see a code js appearing at the bottom of the left panel. Its just there. ContactGroup_Details ().

    Let me know if you have any questions.

  • Passing values between form

    Hi all!

    I have a small question. I started to work on ORacle APEX today and have to pass on the value of my Login Page to the employee detail Page. I know that there is a similar to position
    How to pass a value in form
    But I could not get my reply in this way. As I am lack of time, I can't get a lot.

    Scenario:

    Login page has P111_EMP_NO AND P111_PASSWORD. On submit, there is a process called "Login", where he calls a custom authentication package and verifies its authenticity. After its success, I want this P111_EMP_NO to go to the details used report Page where it displays information about the employee.

    Your help is appreciated.
    Thank you

    Hello

    The value contained in P111_EMP_NO should be available in the APEX provided the substitution string "APP_USER.

    http://download.Oracle.com/docs/CD/E17556_01/doc/user.40/e15517/concept.htm#sthref166

    CITY

  • Default values for form

    I am building a form for my office that submits information to a database.  I would like to use the same form to add new information and modify existing information.  I also want the form to retain the data once it is submitted (i.e. If the user clicks on send and there is a required field blank, the form is re-load with the stored data.)

    I'm not allowed to use javascript (the agency rule).

    I started with something like this for each field:

    <cfinput type="text" name="title" value="#FORM.title#" />

    That's fine, but then I added the Edit option.  A photo of the user entry on a previous page that transmits an id number in the URL (ex: form.cfm? edit = 32) to the form.

    When URL.edit has one value other than zero (default assigned cfparam), it triggers a query that retrieves data from the database.  I want these data to fill in the form, so I tried this:

    <cfinput type="text" name="title" value="#iif(URL.edit eq 0,DE(FORM.title),DE(queryname.title))#" />

    This works perfectly if the query is run, but I get an error when I load the blank form:

    Element TITLE is undefined in QUERYNAME. 
    

    I'm basically train make empty if the form is loaded from scratch, the default value of form make the previous form values if the form is re-charge after submission, or and use the query if a URL parameter is passed.

    Is it possible to make this work?  I don't want to have to write several versions of the form.

    Your half-way, you have just basiclly need to combine your two approaches.

    Set a collection of variables to fill the fields of the form.

    Then if there is a query is run, set this collection with the values of the query.  It is roughly as follows, and there are different ways of this skin for apporached different framework.

  • How to access the value of form element in Database Trigger

    Hello
    Is it possible to access value of form element in triggering the database?
    I have the form that at the table base another element called P14_Insert_to_waiting_list, I want to check the value of this question in the trigger Before Insert deletion of update of TABLE1 and take measures to insert, update, delete record in TABLE2.

    Thanks in advance
    Aali

    Hello

    You can do it with the v function.

    v('P14_Insert_to_waiting_list')
    

    I think the name of the element is case sensitive, in order to verify that

    Edit
    You can also use APEX_UTIL. GET_SESSION_STATE
    http://download.Oracle.com/docs/CD/E14373_01/apirefs.32/e13369/apex_util.htm#CHDEJEJE
    V is just smaller

    You can also use the shortcut function V, instead of APEX_UTIL. GET_SESSION_STATE.

    BR, Jari

    Published by: jarola on October 27, 2009 11:03

  • Default values &amp; javascript in tabular form manual

    Hello!
    I have a table that shows a new line in the upper part of the report... my sql statement is in the form of:
      SELECT 
      NULL EMPNO, 
      NULL ENAME, 
      NULL MGR, 
      NULL SAL, 
      NULL COMM, 
      0 SORTITEM, 
      'N' STATUS, 
      '' MD5_VALUE 
    FROM 
      DUAL
    UNION ALL
    SELECT...etc
    I used to have default values defined in the report attributes but those lost when I started using the approach above.
    How to reference the value of an element on the page, a default value for the line empty? For example, if the element: P60_EMPNO contains the employee ID for work, I want the EMPNO field in the empty line is pre populated with this value.

    Also, I used to have a javascript function which ran "onkeypress" for a field in the new row, but now I don't know how to implement with the new tabular form.

    Thank you!
    Tammy
    (currently using APEX 3.1.2)

    Hi Tammy!

    You can replace all NULL values in the SQL statement by your default values. The only condition would be that you should have at least one field that is NULL so that the code in the process knows that the user has not completed registration. In my example, I check:

    IF vSTATUS = 'N' AND vENAME IS NOT NULL THEN
    

    Yes, as long as the status is ' only and the user has not completed the ENAME field, the record will not be created - if, however, I put a default to ENAME, IF this test would be satisfied and, therefore, a new record would be created each time the page has been sent.

    What does javascript code? The APEX_ITEM. Text() function allows the inclusion of additional attributes for the INPUT tag that will be generated. See: http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_item.htm#CHDCDHJI

    In my example, I have:

    APEX_ITEM.TEXT(5, SAL, 7, 7, 'style="text-align:right;"') "Salary"
    

    Which adds the attribute "style" to the issue of the STARTING salary. You could do something like that to add in "onkeypress =" javascript:yourfunction (...); » "

    Andy

  • Create Acrobat with JavaScript form field and restrict numeric values only

    Hello

    I use a JavaScript loop to create a number of similar form fields. I'm trying to restrict the data entered in these fields of numbers only. I am able to validate the figures who are registered, but the fields still accept text, I don't want to. How can I make sure that text is not accepted?

    Script:

    var x 1 = 53;
    var y1 = 358;
    var x 2 = 123;
    var y2 = 340;

    for (var i = 1; i < 18; i ++) {}
    var name = "MyField" + i;
    var type = "text";
    var page = 1;
    rental var = [x 1, y1, x 2, y2];
    myField var = this.addField (name, type, page, location);
    myField.textSize = 10;
    myField.setAction ("Post", "AFRange_Validate (true, 0, true, 100) '");
    myField;
    Y1-= 18;
    Y2-= 18;
    };

    For example, if you want to display 2 digits to the right of the decimal separator with a comma of any currency symbol, thousands separator, you need to add:

    myField.setAction ('Format', ' AFNumber_Format (2, 0, 0, 0,-"\", false); ");

    myField.setAction ('Touch', ' AFNumber_Keystroke (2, 0, 0, 0,-"\", false); ");

  • My colorfill javascript form does not work as I had hoped? Is it not possible?

    I've been watching shape color fill of similar questions on the forums, but my problem is just a bit different.  My form fill only changes color when I chose it.  I'm putting together a javascript to change the color of a certain value and have that view-capable color at any time as a way for a boss to see quickly if something is red.

    I found another blog that was suggested to use a script and I have it for my needs below:

    I wrote in a release of mouse-based action, I tried to put in the validation, but it does not completely work when I do that.

    var f = this.getField ("MX STATUS");

    If (f.value is 'CMF')

    {

    f.fillColor = color.green;

    }

    If (f.value is "CLA")

    {

    f.fillColor = color.yellow;

    }

    If (f.value is 'NMC')

    {

    f.fillColor = color.red;

    }

    The only type of work, as I said above, when I entered the value of the Exchange but as soon as I leave and enter another area of form, it will go back in blue.  I think I'll need a way to make it go back to blue if an entry is thus cleared.

    I also fear that I'll need to somehow not to accept only these three writings and nothing else.  Finally, I would ideally want a field 'General State of MX' change color based on a combination of the values of all the status "MX".  I have only a basic understanding of C++ of an elective class that I took in 2005.  I don't know if I expect too much of javascript or if I don't quite know how to do.  Thank you for looking into this!

    I use Adobe Acrobat XI worm: 11.0.13

    jiub

    As already mentioned, it is most likely a function of the development of the field. Because of this (and because I don't like my forms to change the default settings of the user), my forms, I have change both the background color and the border color. The background can get covered by the field highlight color, but the color of the border remains visible. It's not quite as "in your face" as the background color, but if you educate your users, the border color will be just as effective as the background color. You can change the color of the border using the property "strokeColor:"

      f.fillColor = color.green;
      f.strokeColor = color.green;
    
  • apex_item. RadioGroup p_idx question of value

    All,

    I have an interactive data report with radio buttons 3. user can select a value radiobutton for processing.

    .......................................
    .......................................
    apex_item.radiogroup( p_idx => rownum , p_value => bestelling_id , p_selected_value => huidige_afdeling_id , p_display => 'LAB' , p_attributes => 'class="afdRadio afdLab" ' , p_onchange => 'javascript:setLab(this.value);' )  AS LAB ,
     apex_item.radiogroup( p_idx => rownum , p_value => bestelling_id , p_selected_value => huidige_afdeling_id , p_display => 'QC' , p_attributes => 'class="afdRadio afdQc" ' , p_onchange => 'javascript:setQC(this.value);' )  AS QC ,
    apex_item.radiogroup( p_idx => rownum , p_value => bestelling_id , p_selected_value => huidige_afdeling_id , p_display => 'Afhaaldesk' , p_attributes => 'class="afdRadio afdDesk" ' , p_onchange => 'javascript:setAfhaalDesk(this.value);' ) AS AFHAALDESK 
    ..............................
    
    
    
    
    

    Problem is that the report can return a large number of lines. Clicking a radiobutton and trying to present, sometimes an apex workflow exception is thrown. I discovered that this has to do with the value of rownum because the value of p_idx can be in 1 and 30.

    So what I did, is to replace rownum with a value of 1, this seems to have solved the problem.

    The other problem now is that when a user clicks a radiobutton on several lines, that is a single value according to the choice, but when to submit all the lines are subject for which the user has selected a value of the radiobutton.

    Example:

    The user select value LAB for 5 rows, but only to see the LAB in the last row selected radiobutton (not thinking that this line will be submitted), but all of the 5 ranks are submitted.

    With rownum all selected values are shown, but there again the we have the problem with the value of p_idx.

    Some tips on how I can fix this?

    Thank you

    Diana

    Hi Diana,

    This seems to be a wrong information:

    Problem is that the report can return a large number of lines. Clicking a radiobutton and trying to present, sometimes an apex workflow exception is thrown. I discovered that this has to do with the value of rownum because the value of p_idx can be in 1 and 30.

    Each APEX_ITEM. function has its first parameter as p_idx that can take a value between 1 and 50. Items by a column in tables which in turn when the page is submitted are mapped to the APEX_APPLICATION. G_F01 in APEX_APPLICATION. G_F50 arrays of type APEX_APPLICATION_GLOBAL. VC_ARR2 in apex session state.

    For the limits of the component you should refer to the following documentation: (see tabular forms)

    https://docs.Oracle.com/CD/E37097_01/doc.42/e35125/limits002.htm#HTMDB28632

    dianap says:

    Thanks Scott.

    I took the example of Vincent. But the problem is in the population of the p_idx with rownum parameter. Rownum can sometimes be greater than 30, and when this is the case, nothing can be submitted.

    Kind regards

    Diana

    Here the question of the solution of Vincent about the radiogroup will lines might exceed the > limit 50 when the rows in the underlying table are > 50.

    The solution uses the paging with the whole line displayed on a page of the report must be<50 (by="" default="" it="" is="" 15="">

    As Oracle APEX page submit takes into account only the game currently displayed rows (regardless what underlying table contains) for the treatment of the displayed tabular form.<50 rows="" pagination="" with="" vincent's="" solution="" will="">

    NOTE: Tabular normal every column has an index and the lines have no limitations, but in a solution of Vincent as it use rownum to index, so a new table will be created for each line.

    I hope that helps!

    Kind regards

    Kiran

  • Does not restore the values of form for the restoration of the tab

    Part of my Web site uses a large number of forms on a single page. On the page, you can filter items (each item has its own form) and modify them. One entry looks like this: [name] [select status] [other Select]. Other important things are that the document has an expiration date in 1981 (to apply a page always up to date) and that change the value in the select results in the triggering of an AJAX function.

    It works perfectly, except for one thing. When filtering State id 1, you get back a little of the element. Let's say that the result of the filter are input 5. Change entry #2 status, which triggered an AJAX function. It works very well, but here's the problem: when close the tab and re-opening with Restore tab, select values become disheveled.

    Due to the execution of a fresh copy of the page, the browser will get a new copy of the page. Entry #2 is now gone (I'll keep calling it that, even if she disappeared because of the filter). Now, here's the problem: Firefox is attempting to restore the value to select it. Entry of the status #3 now has the same status of entry #2, #4 a #3 status and so on.

    I managed to solve this problem on other browsers (Chrome, IE) with this little piece of jQuery:
    {$(document) .ready (function ()}
    {$("form[class^='startingformname']").each (function ()}
    This.Reset ();
    })
    });
    It works perfectly, except for Firefox, which seems to ignore the call to reset...

    As this text is quite long, I'll keep my short question: How do you keep Firefox restore the values of the form (preferably: keep them on the selected item in the HTML)? Now, the user always gets a new copy of the page, and Firefox is trying to restore the old values on this page, even though the HTML code has changed.

    I think your two choices is:

    (1) prevent Firefox from page caching, or

    (2) use a different event to trigger your reset function

    As I understand it, the function $(document) .ready jQuery () raises the event DOMContentLoaded (or equivalent, if not supported by the browser). If the tab is cached in its ' cache fast back-forward ", Firefox can not fire this event when the user returns to the tab, just like Firefox does not always raise the load event in such cases.

    Discover the event more described in the following article and see if you can use it to trigger your reset function in Firefox: https://developer.mozilla.org/docs/Using_Firefox_1.5_caching

    Who is?

  • Question of value - default AutoFill

    I'm having a problem with a text field in my form. I am running version 11.0.7 on OS X 10.9.4.

    The text field is an email address entry and the only property on the ground is one of the built in javascripts validation email: event.rc = eMailValidate (event.value);

    When I start to fill out the form and tab for this field, it auto-remplit with my last entry. I don't have a default values and AutoFill is turned off. The oddity of this is that when I go to change the form - this default value is there.

    Any ideas?

    Try changing the script for:

    If {(event.value)

    Event.RC = eMailValidate (event.value);

    }

  • Pass the value of form field into the message of confirmation box

    Hello

    I created a confirmation box that fires when a user presses a button on the form.

    Under "URL redirection" button, I have the following:

    JavaScript:confirmDelete('Please_Confirm_Reduction_of_Call_Off_Pick_requirement.','REDUCE_CALL_OFF');

    This in turn calls a PLSQL process that perform a database update for a form called P4_PICK_LINE text field

    Is that I would have to include the P4_PICK_LINE in the confirmation message, i.e. "Please confirm reduction of call off sampling requirement pick123' where pick123 is the value of P4_PICK_LINE

    I know that I can pass in variables like session & APP_USER. etc in the message of confirmation, but not sure about text form element values.

    I use the apex 4.0.0.00.46 on windows version 7.

    Any help would be great


    Thank you
    Chris

    Edited by: Cashy on 05-Sep-2012 03:44
    javascript:confirmDelete('Please confirm reduction of call off pick requirement ' + $v('P4_PICK_LINE'),'REDUCE_CALL_OFF');
    

    A complete list of javascript API functions can be found here: http://docs.oracle.com/cd/E10513_01/doc/apirefs.310/e12855/javascript_api.htm

    You may not use session variables unless your variables are sent to the server. As long as you don't offer you will rely on javascript ;)

    Concerning

    Nico

  • JavaScript form validation (stop form submit prior to the selection of the option chosen)

    I check that a "month" has been selected in the options field in a form, which works ok (code below)

    < script type = "text/javascript" >

    <!--

    function checkDayUpdate() {}

    var dm = document.forms.dayUpdate.dayMonth.value;

    inform the customer to select a month to view

    If (dm == null | dm == "Select Month")

    {

    Alert ("Please select a month to view");

    Returns false;

    }

    } / / end of function

    ->

    < /script >

    BUT as soon as I click on the 'OK' prompt in the JavaScript "alert box" in to go back and pick a month I get immediately redirected to the page in the field of 'action' forms until I have a chance to select the month.

    < form name = "dayUpdate" method = "post" action = "updateDays.php" onsubmit ="checkDayUpdate ()" > "

    How can I prevent that from happening?

    See you soon

    Operating system

    You don't say how you trigger the function. Assuming you are using the onsubmit as opening event:

    onsubmit = "return checkDayUpdate()".

    Note that you must return the result of the function, not just run it.

  • The sum of a column with 2 values using Forms 6i

    Hello world
    I have 2 blocks, a main block and the other is
    my block of retail and my block of retail element is a list item
    When I have 2 options to choose, we're for described video and the
    Another is for delay.
    My question is:
    How can I add an item in my form where I will summarize the
    amount of A and L is inserted on this column?

    I forgot about it. DECODE cannot be used in SQL. This time I tried the solution myself in Forms 6i, so I know it works. Set the formulas

    InStr(:Item,'A')

    This returns 1 if the value is A, 0 otherwise. Ditto for the L value of course.

  • Composite validation JavaScript form - two datagrids

    Hi guys,.


    I had a problem with the use of javascript for form validation.

    We have a composite form, each form has a grid. We have therefore two grids that are displayed on the composite shape.

    We want to check if the value entered by the user in a cell in a grid is equal to the sum of the values in a line another grid.

    I tried, but stuck with the currentdatagrid thing.

    Currentdatagrid, from what I've seen, is applicable to the grid that has the focus.

    How can I switch from one grid to another, or can access two grids in the validation function? Any ideas?

    Thank you.

    Hello

    currentDataGrid looks like a HspDataGrid objects, to be able to move on the grids, you can use something like

    currentDataGrid = dataGridArray [0];
    var nextGrid = dataGridArray [1];

    so now wil the first form and nextGrid currentDataGrid will be the 2nd form.

    They both follow the same logic for a HspDataGrid object for example

    Alert (nextGrid.fullPrecision [Row] [col]);

    Ok?

    See you soon

    John
    http://John-Goodwin.blogspot.com/

Maybe you are looking for