Conditional validation?

Hi folks, is it possible using Spry to specify that either a
text field should be filled in OR a checkbox be checked? The
real-world example is either requiring the price of a car to be
filled in or the user has to check a checkbox "POA" which indicates
the vehicle price is available on application. It looks like Spry
only allows me to specify that the price field is required or not,
and the checkbox is required or not, and there seems to be no way
to allow for one of the two to be filled in... is this a hard and
fast limitation, or does someone perhaps know of a way I could do
it?
Thanks in advance, you folks are awesome!

Why don't you generate the validation when the checkbox is
clicked
<input onclick="buildValidation()" />
var textfield;
function(){
if(this.checked){
textfield = new Spry.Widget.Validation('bla','e-mail');
} else {
if(textfield)
try{textfield.destroy()}catch(e){}
basicly if the checkbox is checked it creates a new
validation for your textfield, else it will destory the validation
if there is one found.

Similar Messages

  • Conditional Validation using Spry

    When are we going to see things like conditional validations in DW using spry?
    I am by no means a developer and enjoy using DW for its simplicity but I have a situation at the moment wherby I need to make a text box required if a checkbox group or radio button group is ticked and on top of this I also need to make another textbox required if any of a number of groups are answered 'yes'
    If anyone has any help they can give me to achieve my goal I would be very grateful.
    Also if anyone from Adobe has an answer to my opening question then that would be great
    Thanks

    blandad1976 wrote:
    When are we going to see things like conditional validations in DW using spry?
    I am by no means a developer and enjoy using DW for its simplicity but I have a situation at the moment wherby I need to make a text box required if a checkbox group or radio button group is ticked and on top of this I also need to make another textbox required if any of a number of groups are answered 'yes'
    If anyone has any help they can give me to achieve my goal I would be very grateful.
    Also if anyone from Adobe has an answer to my opening question then that would be great
    Thanks
    Seek and ye shall find!  See here http://forums.adobe.com/message/2978837#2978837
    Gramps

  • Join condition validation error in owb 10gR2

    Hi friends,
    When I tried to validate the join condition in the mapping im getting the below error like
    an error occurred during expression validation, bad expression return type
    When I googled for the above error, I got the below link mentioning like a bug for that join condition validation problem
    https://forums.oracle.com/thread/717194
    In which it is mentioned like a BugNo: 7417869 for that issue.
    Is there any fix for that bug??
    Thanks in advance.
    Brgds,
    Mini

    Dear Allan,
    Happy to get reply from you and sorry for my late reply as im been stuck with other work
    Like you said, I downloaded the required patch 4898608 for the validation bug in mapping with owb 10.2.0.4. By viewing the readme.txt file of the patch I followed the below steps like
    Set the ORACLE_HOME environment variable to point to the OWB Home
    Add $ORACLE_HOME/OPatch  in the PATH
    Stopped the runtime service using the supplied SQL*PLUS script stop_service.sql as a rep_owner
          OWB_HOME/rtp/sql/stop_service.sql
    After the above three steps I applied the opatch like below in cmd prompt
    C:\orahome\10gR3_1\OPatch>opatch version
    Invoking OPatch 10.2.0.4.9
    OPatch Version: 10.2.0.4.9
    OPatch succeeded.
    C:\OraHome_1\OPatch>opatch apply
    Invoking OPatch 10.2.0.4.9
    Oracle Interim Patch Installer version 10.2.0.4.9
    Copyright (c) 2009, Oracle Corporation.  All rights reserved.
    Oracle Home       : C:\OraHome_1
    Central Inventory : C:\Program Files (x86)\Oracle\Inventory
       from           : n/a
    OPatch version    : 10.2.0.4.9
    OUI version       : 10.2.0.1.0
    OUI location      : C:\OraHome_1\oui
    Log file location : C:\OraHome_1\cfgtoollogs\opatch\opatch2013-06-24_18-14-27PM.
    log
    Patch history file: C:\OraHome_1\cfgtoollogs\opatch\opatch_history.txt
    Failed to load the patch object.  Possible causes are:
      The specified path is not an interim Patch shiphome
      Meta-data files are missing from the patch area
      Patch location = C:\OraHome_1\OPatch
      Details = PatchObject constructor: Input file "C:\OraHome_1\OPatch\etc\config\
    actions" or "C:\OraHome_1\OPatch\etc\config\inventory" does not exist.
    ApplySession failed: PatchObject constructor: Input file "C:\OraHome_1\OPatch\et
    c\config\actions" or "C:\OraHome_1\OPatch\etc\config\inventory" does not exist.
    System intact, OPatch will not attempt to restore the system
    OPatch failed with error code = 73
    C:\OraHome_1\OPatch>
    Im not sure why the above error is occuring, kindly help me with that error.
    Thanks in advance.
    Brgds,
    Mini

  • Conditional Validation using JSLink

    I have a User field and a Choice field in a list.  When the Choice field has the option "A" selected I want the User field to be mandatory.  Validation formulas in lists cannot use User field data types so this is not an option.  Is
    JSLink the way to go?  If so how would I implement conditional validation?  I can find examples of simple regex validation but nothing that helps to do conditional validation.
    Caroline

    Hi,
    According to your post, my understanding is that you want to set the User field automatically when the Choice field select a value.
    We can use jQuery to achieve it. Using jQuery .Change() method to monitor the choice, then set the value for the User field.
    The following articles for your reference:
    http://runnable.com/Ue9c4krQF7VjAAAP/how-to-get-selected-option-using-jquery
    http://jasonscript.wordpress.com/2013/08/07/javascript-and-working-with-the-sharepoint-2013-people-picker/
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Conditional validation for drop down list

    Hi all,
    I have been working on getting the conditional validation for drop down list to work but no luck. Here is my situation. I have a page with 'time' and 'source' drop down which contains a list of values along with null value. I have two buttons 'save' and 'close'. when a User clicks on 'Save' button, no checking should occur and the values filled in the form should be stored into the database. When a user clicks on 'Close' button, validation should occur and messages should be displayed saying 'values should be filled' . After the user fills each drop down list and hits close button, changes should be saved to the database. I used the technique posted by Jayashri and wrote the validation code in 'Close button action method'
    Here is my code
    public String btnClose_action() {
    // TODO: Replace with your code
    try {
    if (ddlTime.getSelected() == null || ddlTime.getSelected().equals("")) {
    FacesMessage message3 = new FacesMessage("Please select a value");
    message3.setSeverity(FacesMessage.SEVERITY_ERROR);
    getFacesContext().addMessage(ddlTime.getClientId(getFacesContext()), message3);
    return null;
    if (ddlSourceReq.getSelected() == null || ddlSourceReq.getSelected().equals("")) {
    FacesMessage message4 = new FacesMessage("Please select a value");
    message4.setSeverity(FacesMessage.SEVERITY_ERROR);
    getFacesContext().addMessage(ddlSourceReq.getClientId(getFacesContext()), message4);
    return null;
    sendMail("close");
    } catch (Exception ex) {
    return null;
    public String btnSave_action() {
    // TODO: Process the button click action. Return value is a navigation
    // case name where null will return to the same page.
    sendMail("save");
    return null;
    I did not set the 'required' property of both the drop downs and I dont have any message components in the page. How do I get this to work. Please help.
    Thanks,
    S

    Hi,
    Try this
    HTP.p('
    function validate_form_fields()
    var validation = true;
    if (document.forms[0].fld_1.options[document.forms[0].fld_1.selectedIndex] == null )
    validation = false;
    alert("Selection of FLD1 is mandatory.");
    if (document.forms[0].fld_2.options[document.forms[0].fld_2.selectedIndex] == null )
    validation = false;
    alert("Selection of FLD 2 is mandatory.");
    return validation;
    ');If the above does not work, it could be the definition of the your fld_1 select - options. Looks like they allow null values, and if null is not the first option then selectIndex = 0 will be a not null option by default.
    Moreover, the below has redundant condition as ==0 and &lt; 1 amount to the same thing. selectIndex cannot be negative.
    if ((document.forms[0].fld_1.selectedIndex == 0 ) || (document.forms[0].fld_1.selectedIndex < 1 ))Regards,

  • Mass change Condition valid to dates into Info record

    Hi,
    is there any mass changes for condition validity to dates into purchase info record?????
    i have check into MEMASSIN, there is field for conditions valid to Date,
    Pl. guide .
    Regards,
    Devendra

    Hi,
    It is not possible to  change validity date using MEMASSIN - Mass Maintenance t code.
    You need to create LSMW with recording method to achieve this. we are doing the same.
    It is very easy. And take care that while recording select the validity button and click executive to record the do not double click on the validity tab.
    Reg

  • MM rebate condition validity

    Hi,
    I have the scenario whereby a vendor give a rebate, for a selected period.  within that perios they may grant additional rebate  ie agreement over 1 year - but for august they give higher rebate value.  how can i set this up ?  Im using A002 condition but i cant enter condition validity periods.
    any help appreciated.  No vague answers please.
    cheers
    Graham

    Amy,
    Do you mean to say, you can see the rebate conditions in the item conditions of the invoice before it was released to accounting  and after releasing to accounting they disappeared from the item conditions ?
      I'm sure it shouldn't happen. If it disappears it should disappear irrespective of the release to accounting.
    Analyze the pricing at the item condition level why the rebate conditions doesn't show up.
    If it didn't' work please let me understand your problem..
    Regards,
    Aj.

  • ME47 price = 0 in overview when condition valid in future

    Hi Expert,
    I have a quotation with item 10 and 20 with the same material. When I update item 10 price with 1 and item 20 price with 2, the item 20 price will change to zero and gray. The info record also can not see any update in item 20. infoUpdate is "C".
    Item
    Material #
    Price
    Date from
    Date to
    10
    A
    1
    2015/5/5
    2015/5/6
    20
    A
    2
    2015/5/7
    2015/5/31
    I also checked below notes are implement in my system.
    586030 - ME47: price = 0 in overview when condition valid in future
    360746 - ME47: Update conditions in the info record
    428245 - ME47: Maintaining conditions, SAPSQL_ARRAY_INSERT_DUPREC
    Thanks,
    Leon

    You system is behaving correctly.
    You can see the net price = 0 at overview level, but you can see the original price at details condition level.
    You second line item's condition record is not valid for today's date, that's because it is showing 0 for overview screen. I hope your RFQ document date = 05.05.2015.
    For first line item, your condition record has validity = 05.05.2015 to 06.05.2015. (which is valid for today's date)
    For second line item, your condition record has validity = 07.05.2015 to 31.05.2015 (which is not valid for today's date)
    Change the valid from of the second line item = 05.05.2015, then you can see the price at overview screen.

  • Use of application Item with conditional validation

    Apex 3.2
    On a form, I have two lists :
    - Items TYPE contains A B C and D.
    - Item MANAGEMENT contains NULL, 1, 2 and 3.
    I want to validate that MANAGEMENT is not null only when the value in TYPE are A, B or C.
    I am using the condition "Value of Item in Expression 1 Is Contained within Colon Delimited List in Expression 2"
    I dont want to hard code these values (A B C) so I put them in an Application Item (I also need them somewhere else).
    If I use my application Item in the condition, the validation is not performed (I dont see it listed in debug mode.). If I use the real values (A B C), its working.
    Here's what I put in the Exp2 when using the application item :
    F126_CONST_BUSINESS_CASE:F126_CONST_PROJ_NON_PLANIFIE:F126_CONST_PROJ_PLANIFIE
    I also tried with the form v('F126_CONST_BUSINESS_CASE'): ...
    Any Idea ?
    Thanks in advance.

    Hi Amelie,
    You should consider centralizing your validations inside a package. It will make your code much more readable. In many cases, you won't have to modify your application to modify a validation.
    If your validations are required across different pages, consider having a main package or build package a package for each module (page or page groups).
    The following condition for a validation is easier to understand than "Value of Item in Expression 1 Is Contained within Colon Delimited List in Expression 2".
    Condition Type PL/SQL Expression:
    p1_valdt_pkg.is_item_mangm_mandt(:P1_ITEM_TYPE,:P1_ITEM_MANAGEMENT)
    create or replace function is_item_mangm_mandt (pva_item_type in varchar2,
    pva_item_mangm in varchar2)
    return boolean is
    vbo_valdt boolean default true;
    vva_const_business_case varchar2 (30) default v ('F126_CONST_BUSINESS_CASE');
    vva_const_proj_non_planifie varchar2 (30) default v ('F126_CONST_PROJ_NON_PLANIFIE');
    vva_const_proj_planifie varchar2 (30) default v ('F126_CONST_PROJ_PLANIFIE');
    begin
    if pva_item_mangm is null
    and pva_item_type in (vva_const_business_case, vva_const_proj_non_planifie, vva_const_proj_planifie) then
    vbo_valdt := false;
    end if;
    return vbo_valdt;
    exception
    when others then
    return false;
    end;
    Louis-Guillaume Carrier-Bédard
    My Blog: http://www.lgcarrier.com
    Twitter: http://www.twitter.com/lgcarrier
    APEX Québec: http://www.apexquebec.com
    APEXFramework: http://www.apexframework.com

  • Purchase Info record conditions Validity Period

    Hi,
    In the Inforecord ME12/ME13 the conditions are displayed with validity period which are shown in ascending order.
    Example
    23.10.2008 to 31.10.2008
    01.11.2008 to 30.06.2009
    01.07.2009 to 31.10.2009
    01.11.2009 to 31.12.9999
    The required display or change is in the decending order in Inforecord Conditions
    01.11.2009 to 31.12.9999
    01.07.2009 to 31.10.2009
    01.11.2008 to 30.06.2009
    23.10.2008 to 31.10.2008
    What are the setting required to get the output as above in the decending order?
    Regards,
    Vengat

    Hi,
    SAP  Standard for the infor record is the Ascending Order
    The old validity period will be displayed and in the end the  latest validity period is displayed
    Go to the  program  SAPMM06I
    with the help of ABAP Technical just check whether it is possible to change
    I think it is not possible .
    Please check
    Regards
    Ganesh

  • Trans ME31K:Defaulting item condition validity to contract validity date

    Hello Experts,
    I have a request from my client which is as follows :
    On transaction ME31K (Create Contract), at header I can enter a start date and an end date for the validity of my contract.
    Program name : SAPMM06E
    FIELD-NAMES : EKKO-KDATB & EKKO-KDATE
    The users want the same date range to appear at item level for the conditions :
    Select a new created Item > Conditions.
    Program name :SAPMV13A
    FIELD NAMES : RV13A-DATAB & RV13A-DATBI
    Because, the transaction is changing the program name, it is very difficult for us to replicate the dates at the item's condition level.
    Can you please suggest any idea to implement this solution ?
    Thanks & Regards,
    Mahesh
    Edited by: Maheshsingh Sharma Jhoomuck on Oct 5, 2009 4:52 PM
    Edited by: Maheshsingh Sharma Jhoomuck on Oct 5, 2009 4:53 PM

    Hi raghavendra sai !
    Thanks for the answer.
    But actually, my client wants  'from date' of the items conditions to be defaulted to the date that he indicated on the contract's validity date at header (from date - EKKO-KDATB).
    A contract can be created with a validity interval that starts from a past date.

  • Conditional validation - When field changed

    APEX 4.2.1
    Simple wizard-generated DML form on a table. Hidden numeric primary key (PK), displayed multi-column unique key (UK1,UK2); standard table design.
    Combination of conditional readonly and editable page items. NOT EXISTS validation to replace ORA-0001 with a friendlier error message. Validation should fire only when key fields (UK1 or UK2) are changed. Changes to other fields on the record should be allowed.
    But APEX server side conditions don't track item level changes. For instance, we can't say "Fire this validation only when P1_X or P1_Y are changed"
    How would this sort of thing be done? By adding OnChange dynamic actions on all the page items of interest to set a hidden page item, save that to session state and refer to it in the validation's Condition?
    Is this the right way to approach this?
    Thanks

    VANJ wrote:
    APEX 4.2.1
    Simple wizard-generated DML form on a table. Hidden numeric primary key (PK), displayed multi-column unique key (UK1,UK2); standard table design.
    Combination of conditional readonly and editable page items. NOT EXISTS validation to replace ORA-0001 with a friendlier error message. Validation should fire only when key fields (UK1 or UK2) are changed. Changes to other fields on the record should be allowed.
    But APEX server side conditions don't track item level changes. For instance, we can't say "Fire this validation only when P1_X or P1_Y are changed"
    How would this sort of thing be done? By adding OnChange dynamic actions on all the page items of interest to set a hidden page item, save that to session state and refer to it in the validation's Condition?
    Is this the right way to approach this?Not in 4.2 in my opinion. Drop the validation, let the DML process raise the ORA-00001 exception, and use the new error handling features to provide a user-friendly message.

  • Conditionally Validating InputDate Fields...

    Hi !. My problem is the following one: My project let the user download some reports in excel format. I have like 6 sections each one with a buttom and 2 input date calendars. The thing is that, when the user enters data (let say "asd") and he tries to download another report from another section, a validation appears on a field from another section and the user cant download the report. I tried using af:subForm but I realized that that is for the binding layer not if I am using a convertDateTime for instance... So, what i thought is adding to every buttom a setActionListener to know which buttom was pressed and in a CustomConverter get a reference of it and don't raise up a message for a field that it is not contained in the section of the buttom. The problem is that I can't get a reference to that variable... Does anyone knows if there is another chance ?. Thankx.

    <p>So you want to keep the Group Header (GH) and the Details (D), but suppress the Group Footer (GF) if the count of details records is 1...</p><p>Open the section expert (right click on the grey sections to the left of the canvas) - make sure you have the GF highlighted.</p><p>There is an option named "Suppress" - to the right of that is a formula box [X+2].  Click on that and use a conditional formula for the suppresion.</p><p>Formula:</p><p>if Count({Customer.Customer ID}, {Customer.Customer Name}) = 1 </p><p>then false else true </p><p> </p><p>Note: you will need to replace {Customer.Customer ID} for some field in your details section and {Customer.Customer Name} in the formula with appropriate fields from your report. </p>

  • Condition valid date in inforecord

    Hi experts
    I am getting error in creating info record. The net price valid date shall be normally proposed by system as 31.12.9999.. But in my ides system, the date field is grey and blank, hence system prompting error.
    Please guide me how to get the date proposed by the system
    warm regards
    marias

    Hi
    U need to enter the net value while creating the info record then the system will automatically takes the date evnthough field is gray. U can change the validity after giving net price from by clicking conditions in the menu.
    Ravi

  • Conditional Validation in VO

    Hi All
    I'm developing a web app using jd 11.1.2
    I have a VO field which should be validated against null values, But it should be validated conditionally
    Ex: if client Id is not null validation should be performed to address field is not null
    Pls tell me how to do this
    Thanks
    Padma

    You can do it in many ways
    1. In UI set the show required true and set a message conditionally for the component.
    2. In the EO, through an entity level method validator and set the appropriate triggering attributes in the conditional execution tab
    3. Through an entity level script validator, same as 2 except you write groovy code to check the condition.
    if (clientId !=null )
      if(address == null
        return false
      else
        return true
    }

  • Spry Conditional Validation of Txt Boxes When Using Show/Hide

    Hi everyone.. just a quick question (if their is such a thing) if that is ok...
    I have been working on this single issue for 3 days.. it is driving me mad and hoped someone may be able to point me in the right direction...
    I have a form and it has a radio button with 3 options (about relationship status):
    Married
    Defacto
    Single
    If they select married a text box appears with Enter spouses first name;
    If they select defacto a text box appears with Enter partners first name..
    If single no text box appears..
    User then clicks on next to go to next page..
    All good.. except.. I am using DW CS4 and using spry to validate both txt boxes (spouses first name and partner first name).. problem is only one will be displayed depending on the option selected – Married or defacto.. spry tries to validate both even the hidden one and therefore will not allow the user to go to next page.. as at least one not completed..
    I have spent almost 3 days trying to write a php/java if statement to get spry to only validate text box 1 or 2 if radio button says married, defacto or single etc..
    I would really really really apperciate your input about how I should do this as it is driving me nuts!!!
    Anyway thanks and really hope to hear from someone..
    Cheers from Downunder
    UPDATE:
    Been playing and got this to work:
    <script type="text/javascript">
    function decision(){
    if(document.martial_status.martial_status[0].checked) {
    <!--
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:blur});
    //-->
    sprytextfield1.reset();
    } else if(document.martial_status.martial_status[1].checked) {
    } else if(document.martial_status.martial_status[2].checked) {
    window.alert("test3");
    } else {
    window.alert("Pick something!!");
    // -->
    </script>
    BUT (and always a but).. if person goes back and selects say single rather then married after already clicking married the spry error msg is already in place for married.. and person cannot go to next page.. The joys.. tried martial_statur.reset and destroy and does clear the error message but still does not allow user to go to next page..
    Any thoughts? Thanks in advance..

    You can destory the validation:
    sprytextfield1.destroy();
    and it should validate.

Maybe you are looking for

  • Express card, Datacard 3G HSDPA

    Hi I just got my Macbook pro and I'm a bit dissapointed. I wanted to fit a 3 G data card and I cannot find a way to do it. Can anybody please advise what I shoudl do now? Regards Mike

  • What's going on with iOS7?

    Can't download. I keep getting an error message.

  • A nest within a nest and the multiple-query blues...

    Hi all: Complex problem here, so bear with me please. I'm still building this corporate database for purposes of inventory tracking, and my latest problem follows. Here's the setup. I have a MySQL database with 3 tables (there are actually more, but

  • Noob question part 2, I DL the App Handcent ..

    when I click new message, my contacts come up but I cant check any to send a new text. How do I send texts using Handcent? Thanks for any info.

  • Starglow presets

    Does anyone know is there meant to be presets with trapcode starglow?  From everything Ive read online the answer is yes but I dont appear to have them. Ive tried refreshing effects and presets and I have animation presets showing in the effect contr