Help with conditional styling

Hi all,
I have a dynamic report and I want to right align a column when it contains a number. I tried using a column template with a pl/sql expression but it simply doesn't work.
Anybody knows how to ?
thanks
Mauro

Carl Blackstrom just Re: Report "like" a form about "Named Column (row template)," which I'd not heard of before. This is an option when you create a report template form scratch.
Using one of these you can specify the Row Template as
<tr><td>#1#</td><td style="text-align:#3#;">#2#</td></tr>to have the 2nd column aligned according to the value in the 3rd.
This means that the query must calculate whether the value is a number. You can use regular expressions for this in 10g:
WITH
  data AS(
    SELECT '9382' a FROM dual UNION ALL
    SELECT '-264' a FROM dual UNION ALL
    SELECT '9.22' a FROM dual UNION ALL
    SELECT '0.3' a FROM dual UNION ALL
    SELECT '$2839.22' a FROM dual UNION ALL
    SELECT 'The Prisoner' a FROM dual
SELECT
  a,
  CASE WHEN regexp_like(a,'^-{0,1}\d*\.{0,1}\d+$')
    THEN 'right'
    ELSE 'left'
    END AS align_col
FROM databut in earlier versions you might have to call a custom function.

Similar Messages

  • Need help with conditional query

    guys this is just an extension of this post that Frank was helping me with. im reposting because my requirements have changes slightly and im having a hell of a time trying to modify the query.
    here is the previous post.
    need help with query that can look data back please help.
    CREATE TABLE "FGL"
        "FGL_GRNT_CODE" VARCHAR2(60),
        "FGL_FUND_CODE" VARCHAR2(60),
        "FGL_ACCT_CODE" VARCHAR2(60),
        "FGL_ORGN_CODE" VARCHAR2(60),
        "FGL_PROG_CODE" VARCHAR2(60),
        "FGL_GRNT_YEAR" VARCHAR2(60),
        "FGL_PERIOD"    VARCHAR2(60),
        "FGL_BUDGET"    VARCHAR2(60)
      )data
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','00','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7200','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7600','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','11','2','600');
    I need to find the greatest grant year for the grant by a period parameter.
    once i find the greatest year i need to check the value of period 14 for that grant for the previous year and add it to the budget amount for that grant. however if their is an entry in the greatest year for period 00 then i need to ignore the period 14 of previous year and do this calculation current period +(current period - greatest year 00)
    hope that makes sense so in other words with the new data above. if i was querying period two of grant year 11. i would end up with $800
    because the greatest year is 11 it contains a period 0 with amount of $400 so my total should be
    period 2 amount $ 600
    period 0 amount $ 400 - period 2 amount of $600 = 200
    600+200 = $800
    if i query period 1 of grant 360055 i would just end up with 800 of grnt year 10.
    i have tried to modify that query you supplied to me with no luck. I have tried for several day but im embarrased to say i just can get it to do what im trying to do .
    can you please help me out.
    here is the query supplied by frank kulash who gracefully put this together for me.
    WITH     got_greatest_year     AS
         SELECT     fgl.*     -- or whatever columns are needed
         ,     MAX ( CASE
                     WHEN  fgl_period = :given_period
                     THEN  fgl_grnt_year
                    END
                  ) OVER ()     AS greatest_year
         FROM     fgl
    SELECT     SUM (fgl_budget)     AS total_budget     -- or SELECT *
    FROM     got_greatest_year
    WHERE     (     fgl_grnt_year     = greatest_year
         AND     fgl_period     = :given_period
    OR     (     fgl_grnt_year     = greatest_year - 1
         AND     fgl_period     = 14
    ;Miguel

    Hi, Miguel,
    Are you waying that, when the greatest year that has :given_period also has period='00' (or '0', or whatever you want to use), then you want to double the budget from the given_period (as well as subtract the budget from the '00', and not count the pevious year's '14')? If so, add another condition to the CASE statement which decides what you're SUMming:
    WITH     got_greatest_year     AS
         SELECT       TO_NUMBER (fgl_grnt_year)     AS grnt_year
         ,       fgl_period
         ,       TO_NUMBER (fgl_budget)     AS budget
         ,       MAX ( CASE
                       WHEN  fgl_period = :given_period
                       THEN  TO_NUMBER (fgl_grnt_year)
                      END
                    ) OVER ()     AS greatest_year
         FROM       fgl
    ,     got_cnt_00     AS
         SELECT     grnt_year
         ,     fgl_period
         ,     budget
         ,     greatest_year
         ,     COUNT ( CASE
                       WHEN  grnt_year     = greatest_year
                       AND       fgl_period     = '00'
                       THEN  1
                         END
                    ) OVER ()          AS cnt_00
         FROM    got_greatest_year
    SELECT       SUM ( CASE
                        WHEN  grnt_year     = greatest_year                    -- New
                  AND       fgl_period     = :given_period                    -- New
                  AND       cnt_00     > 0            THEN  budget * 2     -- New
                        WHEN  grnt_year     = greatest_year
                  AND       fgl_period     = :given_period       THEN  budget
                        WHEN  grnt_year     = greatest_year
                  AND       fgl_period     = '00'            THEN -budget
                        WHEN  grnt_year     = greatest_year - 1
                  AND       fgl_period     = '14'     
                  AND       cnt_00     = 0            THEN  budget
                    END
               )          AS total_budget
    FROM       got_cnt_00
    ;You'll notice this is the same as the previous query I posted, except for 3 lines maked "New".

  • Help with Conditional Display and Validation

    Version 4.1.1.00.23
    Hello,
    I'm having a difficult time with a conditional display and validation I'm hoping someone can help with.
    Requirements:
    When the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox)
    If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL)
    What I've tried
    Create a Dynamic Action on the Start Date
    Event: Change
    Selection Type:Item(s)
    Items(s): P51_START_DATE
    Condition: none
    True Action Section:
    Action: Show
    Fire on Page Load: Checked
    Show all page items on the same line: No
    Affected Items Section:
    Selection Type:Item(s)
    Item(s): P51_CHANGE_REASON,P51_CHANGE_DESC
    I've also created a Dynamic Action with similar settings for the P51_END_DATE.
    I created a Validation for the P51_CHANGE_REASON as Function Returning Error Text:
    DECLARE
        v_start_date    work_items.start_date%TYPE;
        v_end_date      work_items.end_date%TYPE;
    BEGIN
        SELECT start_date
              ,end_date
        INTO   v_start_date
              ,v_end_date
        FROM   work_items
        WHERE  work_items_id = :P51_WORK_ITEMS_ID;
        IF ( (v_start_date != TO_DATE(:P51_START_DATE,'DD-MON-YYYY') OR v_end_date != TO_DATE(:P51_END_DATE,'DD-MON-YYYY') ) AND
              :P51_CHANGE_REASON IS NULL ) THEN
            RETURN 'Change Reason must have a value';
        END IF;
    END;
    The Issue
    I tried to create another Dynamic Action to hide the P51_CHANGE_REASON and P51_CHANGE_DESC fields on page load, but when either of the date fields are changed and the validation is fired the P51_CHANGE_REASON and P51_CHANGE_DESC are hidden again.
    There are two buttons to submit the page: 'SAVE' will submit the page and stay on the page and 'SAVE_CHANGES' will submit the page and branch to the previous page (which is a report with EDIT buttons to edit the record).
    I can't get the page load Dynamic Action to NOT fire when the validation is fired.
    I hope this is clear and if not what information can I provide?
    Thanks,
    Joe

    Phil,
    Thank you for looking at this.
    Yes if the Change Reason is NULL when the edit page is displayed then the Change Reason and Change Description fields are hidden. If the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox). If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL).
    The problem I'm having is that if no Change Reason is entered and the page is saved thereby firing the validation the Change Reason and Change Description fields are hidden again (because of the On-Load Dynamic Action to hide them). So now the user can't put in a Change Reason...unless they change one of the date fields again which isn't going to be accepted.
    Is there a way to determine if a validation error was fired and be able to use that on the On-Load Dynamic Action to hide the two fields? Something like...If the validation fired then don't run?
    Please let me know if I'm still confusing you.
    Thanks,
    Joe

  • Help with conditional build expressions

    I'm using RoboHelp HTML and creating WebHelp Pro layouts. I
    want to create five (or more) different versions of the Help tool
    for our various groups of users.
    Here's what I'd like to do: Create a conditional build tag
    for each of the versions (i.e. each of our groups of users). I
    could name them as follows:
    group1
    group2
    group3
    group4
    group5
    Then, I would associate each topic with one or more of the
    build tags. For example, topic1 may be for group1 and group2;
    topic2 may be for group1 and group4. Etc.
    The problem is thus: When I want to create the version for,
    say, group1, my expression ends up excluding the other groups. In
    the end, this omits any topics associated with group1 that are also
    associated with the other build tags (i.e. the other groups).
    Is there an expression I can use to prevent these topics from
    being omitted? Perhaps the use of parentheses?
    The only solution I've used is tedious: I create many build
    tags--one for each variation. For example, I'd have a
    group1group2group3 build tag, a group1group3 build tag, a
    group1group4 build tag, etc. Then, I just associate one build tag
    with each topic. When I'm creating a version for group1, for
    example, I'd just include all topics with a build tag that includes
    group1 (e.g. group1, group1group3, group1group2group3, et. al.). I
    omit the others (e.g. group2group3, group2group4,
    group2group3group4group5...et. al.).
    As you can imagine, this solution is problematic. First, I
    have to create and keep track of many many build tags. Then, if I
    want to create another version of Help, I need to change all the
    build tags to include this new group.
    I'm sure there must be a better build tag expression for what
    I'm trying to accomplish. Please help! Thanks!

    There is indeed an expression! Unfortunately, the option is
    normally hidden, so it can be tricky to find. Here's what you do:
    1. Define the build tags.
    2. Apply them to your topics. OVERLAPPING IS ENCOURAGED! That
    is to say, you can assign tag1, tag2, and tag3 to a single topic.
    3. Right-click the desired layout and select Properties.
    4. Click the Define button to the right of the Conditional
    Build Tag drop-down menu. The Define Conditional Build Tag
    Expression dialog will appear.
    5. Click the Advanced button. The Advanced area will appear
    at the bottom of the dialog.
    6. Select a tag from the Available Conditional Build Tags
    drop-down menu.
    7. Click the Add Tag button. The selected tag will appear in
    the Conditional Build Tag Expression display window.
    8. Click the AND button.
    9. Select another tag from the drop-down menu.
    10. Click the Add Tag button.
    11. Repeat steps 8-10 for each tag you wish to add to the
    expression.
    12. Click the OK button to close the dialog.
    13. Click the Save button to save your layout with the new
    build expression.
    That's it! The trick is to use the ADVANCED button in the
    Define Conditional Build Tag Expression dialog. Doing so allows you
    to build inclusional expressions rather than exclusional
    expressions, so you can avoid the hassle you described in your
    post. Using this method, I defined two build tags (A and B) and
    applied them to three topics as follows:
    * Topic 1: Tag A
    * Topic 2: Tag B
    * Topic 3: Tags A and B
    I then defined an expression that simply included tag A. When
    I compiled my help, topics 1 and 3 appeared in the output, but
    topic 2 did not.

  • Help with conditions AND installer Packages

    Hello everyone,
    I need help still learning.
    My shell is SHELL=/bin/sh based on env command
    I am trying to write a package with Iceberg to push Office 2004 to 250 Macs. I need a preflight script with a condition that will stop my script if /Applications/Microsoft Office 2004 exists OR if OFFICE 2004 exists. Don't know if searching on the folder name is the best or if there is better way
    If it doesn't exist I want it to continue with with placing Office 2004 in the /Applications folder.
    I don't know how to do conditions (If, then, end)
    PREFLIGHT SCRIPT
    IF /Applications/Microsoft Office 2004 folder exist = STOP
    IF /Applications/Microsoft Office 2004 folder doesn't exist continue with laying down files/folder in the package.
    LAYDOWN FILES
    LAY DOWN FILES IN ICEBERG FILE SECTION OF THE PACKAGE
    POSTFLIGHT SCRIPT
    #!/bin/sh
    #Change to root directory
    cd /
    # Move Microsoft Office X folder to Messages Received folder
    mv /Applications/Microsoft\ Office\ X /Messages\ Received
    #Open Office 2004 Installer
    open /Applications/Utilities/Installers/Office2004Installer
    G4 1.42   Mac OS X (10.3.5)  

    Hi Dmcrory,
       The answer to your question about ORing tests in a shell conditional statement could be something along the lines of:
    if [ -d /Applications/Microsoft\ Office\ 2004 -o -d "/Applications/OFFICE 2004" ]
    then
       exit 1
    fi
    I've included two different styles of quoting so you can choose which you prefer.
       That said, you appear to be asking us how to write shell scripts, starting from scratch. Time that you spend studying benefits you forever and sometimes benefits us, while time we spend doing your work is at best a trivial review for us. The above "-o" option, and many others, are documented at the compound comparison section of the Advanced Bash-Scripting Guide. Don't let the name fool you; the Guide actually assumes very little. The "Advanced" adjective refers to the completeness of work. In fact there are many good references.
       I used to have a long post of links to what I think are some of the better beginning UNIX tutorials and books. However, as others posted great links and I stole them, my post became too long so I put it in a web page. Bill Scott did the same thing so here is Bill's and here is mine.
       This is being written after reading your exchange with Roger. When you execute code that doesn't work, we certainly have no chance of knowing why without seeing the code. It generally helps a lot to see the output as well.
    Gary
    ~~~~
       University politics are vicious precisely because the
       stakes are so small.
             -- C. P. Snow

  • Need help with Conditional Audio

    Hello again! So early on into a course, after a couple intro slides, I have a sorting slide to direct users to other parts of a course (self-led learning in a way). However, I have an audio narration that plays on entry to that slide (not slide audio, it plays via advanced actions). I'm trying to figure out a way so that once they have viewed that slide once and heard that audio the first time, any time they get sent back to this sorting slide, they don't hear the audio again. How might this be done?
    What I have already tried: I've tried two things, first I set up a variable called Sort_Audio. On exit of the slide previous, Sort_Audio would be assigned a value of 10. On entry to the sorting slide, an advanced action would check if Sort_Audio is equal to 10. If it is, it plays audio (and clears another variable that is unrelated, I just needed to do both things, so I combined them). I have On Exit from the sorting slide an advanced action that resets Sort_Audio to 0 so that when a user gets sent back to that sorting slide, it would theoretically not star the audio. Problem with this in the first place is for some reason it won't even play the audio the first time.
    The other thing I tried was quite similar, but instead of assigning values to slides I tried cpInfoLastSlideViewed and equalled it to the name of the previous slide, as well as doing the same thing for cpInfoPreviousSlide. Neither seemed to work.
    Any help would be much appreciated! Thanks!

    The problem is resolved. Using TTS, the audio went onto the slide. I had not removed it from the slide audio so that the Advanced Action could work. Lieve, I got it to work by being extra careful to get each step correct and complete and assuring that the slide didn't have audio attached to it. Rod, I could not get the test project to work with audio attached to a smart shape. I believe it is because I am not controlling visibility of the smart shape--a logic test for another project and another day.
    Here is what I finally got to work:
    I created a project to get the procedure working before I put it into the big project. Here is a description of the test project.
    Slide one has a smart shape (not used as a button) and a button which goes to the next slide. There is slide audio that plays when the slide is viewed.
    Slide two has a smart shape that is used as a button to go back to slide one.
    First Test with simple Advanced Action (no increment of variable):
    Variable used is called "v_visit"
    Conditional advanced action is called "checker"
    If v_visit is equal to 0
    Then Play Audio "text to audio X" (created with TTS. I also tested it with recorded voice in a second test, "RecordingX.wav")Assign v_visit with 1
    Else Continue
       Slide one, on enter, execute Advanced Action "checker"
                        on exit, No Action
    Second Test with different Advanced Action (variable increments):
    Variable called "v_counter"
    Advanced Action (conditional) called "menuAudioChecker"
    First condition ("setCounter")
    If 1 is equal to 1
    Then Expression v_counter = v_counter + 1
    (Else not used)
    Second condition ("checkCounter")
    If v_counter is equal to 1
    Then Play Audio "Text to AudioX" or "RecordingX.wav"
    (Else not used)
    Slide one, On Enter Execute Advanced Action "menuAudioChecker"
    On Exit, No Action
    On this "Second Test" I added a smart shape to display the contents of v_counter and it counts as expected. As Lieve has indicated in other posts, if one desired a different audio to play based on the value of v_counter this would allow that to happen. In my case in the production project I could play audio associated with section 6 when they return to the menu after completing section 6.
    Thank you for patiently working with me to resolve this issue (mostly due to my own oversights).
    Most importantly, thank you for the excellent Advanced Action model to use for the project.
    Michael

  • Need help with conditional display

    I found a older thread (704012) that explains how to conditionally display a link using style.  Which is what I want to do.  The part I'm having trouble with is that part of the instructions say to put
    class="row_has_values_#HAS_VALUES#"
    in the Link Attributes which I have done.  I also have a column in the report called HAS_VALUES and I'm properly populating it in my select.  I know because I left it displayed while I'm testing.  I can run the report and I have Y's and N's showing up in that column but the conditional part does not work.  When I look at the page source (below) I see that in the html the #HAS_VALUES# has not been replaced by the actual Y or N.  I think that's where I'm having trouble?  I think it might work if there was a Y or N in that but I don't understand why that didn't happen.
    <tr class="odd"><td headers="LINK"><a href="f?p=125:3:12628966088981::NO::P3_PROGRAM_KEY:2" class="row_has_values_#HAS_VALUES#"><img src="/i/e2.gif"  border="0"></a></td><td  align="left"

    LawrenceJ wrote:
    I've continued to snoop around and see lots of posts on conditional display in reports.  Common desire I guess.  I saw some stuff that I interpreted to suggest that what I'm trying to do may not work in interactive reports, only in classic reports.  Does that sound familiar?
    That would certainly apply to anything template-related. However there have been enhancements to IRs (like adding HTML Expressions) that might supersede information in older posts. If you provide a link to the sources you've found and the APEX version you're using someone will be able to confirm whether that information is relevant.
    Many other posts on doing things conditionally in reports seemed to lean towards "selecting" the html based on data values and then just letting that get put in the report column.  That looks promising but sure is a bit ugly.  I've very little apex experience but lots of mod pl/sql and that sort of solution was pretty common when I did stuff with it.  I saw a little suggesting using templates as a solution but I'll confess to not understanding it at all.
    As I pointed out in the original thread, if the conditional display of the link is in any way security related then CSS or JS/jQuery methods are not acceptable. If the user is not supposed to be able to click the link or see any data contained in it, then you have to use a method that ensures that the link element never reaches the browser.
    Hard-coding the link HTML in the report query is the common approach, but is as you say a bit ugly. Using a custom report template (my favourite APEX subject) enables clean separation of the report query, conditional logic and HTML structure. If you know HTML then you're advised to get familiar with using templates in APEX. You'll find this a major advance on the PL/SQL web toolkit. What is it that you're not understanding about using templates?

  • Help with conditional statements

    i am being forced to develope a game and really only know the
    basics of flash. What i need to have happen is have a movie clip
    drag something but only when the clip is in its closed position.
    Essentially it would be like having a movie clip of a hand that
    opened and closed and when the hand was closed you could press a
    button to make it drag something. Can anyone help me with the code
    i need for this.
    Any help would be appreiciated.

    You didn't say whether the hand movie clip is looping its
    action or not.
    Assuming that the clip constantly loops between an opened and
    closed hand, here is a simple script.
    First, determine which frame number is the open hand (and it
    should come AFTER the open position). In my examples, I'll assume
    that the hand closes on frame 20 inside the movie clip.
    Second, give your movie clip an instance name. In this
    example, I'll call it "hand".
    Finally, place this script in an empty keyframe on the root
    timeline, either at frame 1, or at the same frame number where the
    hand first appears:
    hand.onPress = function() {
    if (this._currentframe>=20) {
    this.stop();
    this.startDrag();
    hand.onRelease = function() {
    this.stopDrag();
    this.play();
    Hope this helps.

  • Help with conditional Spry Form Validation

    Hi,
    I am creating some validation for this form and need some help.
    Need to require a finish to be selected if a qty is selected and visa versa.
    I have got this part working but can't get it to destroy the validation if the qty/finish is added and then removed.
    Here is the code for just the 2 fields:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Deleting and rebuilding validations</title>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    // build validations and delete / destroy them
    function val(e){
         // get the value
         value = e.value;
            //check if value is greater than 0
          if (value>= 1 ){
              // if it is then turn on validation
                  var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", "none", {isRequired:true});
            return true;
    function val2(e){
         value = e.value;       
          if (value= "" ){
                  var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {isRequired:false});
            else { var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {isRequired:true}); }
            return true;
    </script>
    </head>
    <body>
    <form id="form1" method="post" action="#">
         <p><span id="spryselect1">finish:
             <select name="finish" id="finish" onclick="val2(this);" >
            <option>please select</option>
            <option value="6, Antique Wiluna White">Antique Wiluna White</option>
            <option value="12, Antique Wiluna White Gloss">Antique Wiluna White Gloss</option>
            <option value="2, Charred Oak">Charred Oak</option>
            <option value="10, Charred Oak Gloss">Charred Oak Gloss</option>
            <option value="5, Gentle Beige">Gentle Beige</option>
            <option value="1, Refined Oak">Refined Oak</option>
            <option value="9, Refined Oak Gloss">Refined Oak Gloss</option>
            <option value="4, Rocksalt">Rocksalt</option>
            <option value="7, Snowdrift">Snowdrift</option>
            <option value="13, Snowdrift Gloss">Snowdrift Gloss</option>
            <option value="3, Vicenza Walnut">Vicenza Walnut</option>
            <option value="11, Vicenza Walnut Gloss">Vicenza Walnut Gloss</option>
            <option value="14, 2 Pack Gloss White">2 Pack Gloss White</option>
          </select>
             qty:
    </span><span id="sprytextfield1">
    <input type="text" name="qty" id="qty"  onblur="val(this);" />
    </span>
    <input type="submit" value="Submit" />
    </p>
    </form>
    <script type="text/javascript">
    var sprytextfield1, spryselect1;
    </script>
    </body>
    </html>
    Also is there a shortcut so this doesn't have to be repeated for all 80 or so fields?
    Cheers

    I am very busy at the moment with having a few projects on hand. Maybe the following example will help you. If not, please come back here.
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Deleting and rebuilding validations</title>
    <link href="http://labs.adobe.com/technologies/spry/widgets/textfieldvalidation/SpryValidationTextFiel d.css" rel="stylesheet">
    </head>
    <body>
    <form id="form1" method="post" action="#">
      <p>
        <input type="radio" name="radio" id="Married" value="Married" onclick="val(this);">
        <label for="Married">Married</label>
      </p>
      <p>
        <input type="radio" name="radio" id="Defacto" value="Defacto" onclick="val(this);">
        <label for="Defacto">Defacto</label>
      </p>
      <p>
        <input type="radio" name="radio" id="Single" value="Single" onclick="val(this);">
        <label for="radio">Single</label>
      </p>
      <hr>
      <span id="sprytextfield1">
        <label for="f_married">Married</label>
        <input name="married" id="f_married" type="text" value="">
        <span class="textfieldRequiredMsg">A value is required.</span>
      </span>
      <span id="sprytextfield2">
        <label for="f_defacto">Defacto</label>
        <input name="defacto" id="f_defacto" type="text" value="">
        <span class="textfieldRequiredMsg">A value is required.</span>
      </span>
      <span id="sprytextfield3">
        <label for="f_single">Single</label>
        <input name="single" id="f_single" type="text" value="">
        <span class="textfieldRequiredMsg">A value is required.</span>
      </span>
      <hr>
      <input type="submit" value="Submit" />
    </form>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryValidationTextField.js"></script>
    <script>
    var sprytextfield1,
            sprytextfield2,
            sprytextfield3;
    // build validations and delete / destroy them
    function val(e){
        // get the value
        value = e.value;
        // see what radion button we have
        if(value == "Married"){
            // if there inst a validaton build one
            if(!sprytextfield1){
                sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
            // if there is a validaiton in sprytextfield destory it, and clear the variable
            if(sprytextfield2 && sprytextfield2.destroy){
                sprytextfield2.resetClasses();
                sprytextfield2.destroy();
                sprytextfield2 = null;
            // same as the rest
            if(sprytextfield3 && sprytextfield3.destroy){
                sprytextfield3.resetClasses();
                sprytextfield3.destroy();
                sprytextfield3 = null;
        } else if(value == 'Defacto'){
            if(!sprytextfield2){
                sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
            if(sprytextfield1 && sprytextfield1.destroy){
                sprytextfield1.resetClasses();
                sprytextfield1.destroy();
                sprytextfield1 = null;
            if(sprytextfield3 && sprytextfield3.destroy){
                sprytextfield3.resetClasses();
                sprytextfield3.destroy();
                sprytextfield3 = null;
        } else if(value == 'Single'){
            if(!sprytextfield3){
                sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
            if(sprytextfield1 && sprytextfield1.destroy){
                sprytextfield1.resetClasses();
                sprytextfield1.destroy();
                sprytextfield1 = null;
            if(sprytextfield2 && sprytextfield2.destroy){
                sprytextfield2.resetClasses();
                sprytextfield2.destroy();
                sprytextfield2 = null;
        // proceed with the rest as normal
        return true;
    </script>
    </body>
    </html>
    Gramps
    Carn the Pies

  • A bit more help with conditions

    I am working on some animated rollover buttons (movieclips) that require two conditions:
    1. Once the button is rolled over, clicking will switch between a word symbol and it's definition
    2. Due to the above, I also need two rollOut  states as well.
    I made a run at both, with the results posted here: www.midnyc.com
    There are definitely some bugs, I am just not sure where to go from here. I see that if you mouse over and interact, then get off, when you go back onto the button, it is still in the same pattern (has not reset) and that needs to happen.
    Also, on the first click, nothing happens... a second click is required to get the switch to happen. Below is my code thus far:
    btn_disHit.buttonMode = true
    btn_disCase.buttonMode = true
    btn_disCase.buttonState = "on";
    btn_disHit.addEventListener (MouseEvent.CLICK, disToggleClick);
    btn_disHit.addEventListener (MouseEvent.MOUSE_OUT, disToggleOut);
    btn_disHit.addEventListener (MouseEvent.MOUSE_OVER, disOver);
    function disOver (e:MouseEvent):void{
        btn_disCase.gotoAndPlay ("disOver");
    function disToggleClick (e:MouseEvent){
        if (!e.currentTarget.toggle){
            btn_disCase.gotoAndPlay ("disClick")
        else {
            btn_disCase.gotoAndPlay ("disClickB")
    e.currentTarget.toggle = !e.currentTarget.toggle;
    function disToggleOut (e:MouseEvent){
        if (!e.currentTarget.toggle){
            btn_disCase.gotoAndPlay ("disOutB")
        else {
            btn_disCase.gotoAndPlay ("disOut")
    e.currentTarget.toggle = !e.currentTarget.toggle;

    I do see that I need to set an if (on this frame, go to this frame) type of condition, rather than the current target, I guess I am just not sure how to code a conditional to recognize which frame it is in to go to the other, rather than using current target?

  • Help with conditional answer, cont'd "blank" discussion

    Got the answer to my blank question below, but the client has asked that when an item is overshipped, there should be a "0" in the backordered spot. When the amount shipped is the same as the amount ordered, it should be "blank". When the item ordered is undershipped, the difference shows up in backordered. I've tried a few different ways of scripting it, but it either messes up the formula (so I don't get the mathematical answer I need) or it doesn't work.
    So far I have
    form1.#subform[0].Table1.Row1.backordered::calculate - (FormCalc, client)
    Sum(ordered-shipped)
    if (Sum(ordered-shipped)>0)
    then backordered=Sum(ordered-shipped)
    elseif (backordered<0)
    then backordered=0   *also tried this with "null"*
    endif
    I changed the pattern rules so a blank shows when the answer is 0, but sometimes I want the answer to be "0" I just don't know in which box I'll need that. Tried to add "calculated - user can override" but it doesn't let me put a "0". The zero shows up when I click the box in preview, but then disappears and won't let me override.
    What am I doing wrong?

    Hi,
    Thank you both for your replies.
    I'm pretty new to this so had a little trouble understanding your recommendations.
    However, I've figured something out which could probably be prettier but I'm happy for now that it works!
    In case anyone is interested, here's a description of the solution I've managed to get working:
    o one select box is declared on the page, with no options specified.
    o on page load, a javascript function is called which:
    ...hides the select box first time in (i.e the user has not answered my 'yes/no' question)
    ...shows the select box any other time (i.e. any time following the answering of the yes/no question), creates the correct options according to the answer provided, and sets one of the options to 'selected' based on a value retrieved from the bean. This value is declared as a hidden input on the page and a new getter method for this was added to the bean - it returns the actual value set when a selection is made from the box.
    o in addition to the onload function, I also have a function that is invoked when the user clicks on the yes/no radio buttons. This function removes all the options from the select box, recreates the correct options according to the answer provided to the yes/no question, sets the selected option to my default value of 'Please select' and finally, makes sure the select box is actually shown.
    Thank you again.

  • Help with "conditional" PAT

    Hello, I have a customer that have a mail server on LAN. In the router that connect to Internet I configured a static nat:
    « ip nat inside source static tcp PRIVATE_IP 25 PUBLIC_IP 25 extendable »
    The customer receives e-mails from outside but, when they send an e-mail, the mail server uses another port that not 25 so, the router nats the connection to Public WAN IP address of the router and not the PUBLIC_IP from the static nat.
    The customer wants to use the PUBLIC_IP from the static nat configuration when they send an e-mail.
    It seems to me that it should be something like conditional nat. Any request from that specific PRIVATE_IP server to any on port 25, the router should nat to PUBLIC_IP (not the wan public IP fo the router).
    Any ideas ? Route-map ?
    Best regards

    Hi,
    You can use a route-map but first you have to setup the correct acl to point the smtp and pop ports to be used only for the email server, by the momment you can use another static nat for the port 110 that use pop3 mapping the email server.
    If you are interested on the route-map option please let me know.
    Regards.
    Sent from Cisco Technical Support iPhone App

  • Help with Photogallery Styling

    Hi everyone,
    Hoping someone can help me ASAP, as I am finishing off a client site soon.
    This is in regards to the Photo Gallery Module.
    I would like to apply a stroke to the Gallery, as well, be able to change the opacity on the hover state.
    Haven't applied the hover state to the CSS yet, but I tried the stroke CSS and it is still not working (taken from Firebug).  See below:
    <STYLE type="text/css">
    element.style {
    border: 2px solid #333;
    color: rgb(0, 0, 0);
    </style>
    {module_photogallery,22044,6,,24,138,138,,fill_proportional}
    What am I doing wrong? Also, how do I apply a hover state (opacity change).
    Thanks,
    Aaron

    Hi everyone,
    Hoping someone can help me ASAP, as I am finishing off a client site soon.
    This is in regards to the Photo Gallery Module.
    I would like to apply a stroke to the Gallery, as well, be able to change the opacity on the hover state.
    Haven't applied the hover state to the CSS yet, but I tried the stroke CSS and it is still not working (taken from Firebug).  See below:
    <STYLE type="text/css">
    element.style {
    border: 2px solid #333;
    color: rgb(0, 0, 0);
    </style>
    {module_photogallery,22044,6,,24,138,138,,fill_proportional}
    What am I doing wrong? Also, how do I apply a hover state (opacity change).
    Thanks,
    Aaron

  • Need help with conditional join....

    Table 1 - Student
    ID# Name
    1 # A
    2 # B
    3 # C
    4 # D
    Table2 - Marks
    ID Marks Display
    1 # 10 # Y
    1 # 20 # Y
    1 # 14 # N
    2 # 12 # N
    2 # 13 # N
    3 # 12 # Y
    Result...Need query to do this?..
    Want to join above two tables and display marks as X when there is no ID in table marks or there is ID but all marked with display as 'N'...if there is one or more
    marked with Y then display with marks..
    I am using oracle 11i.
    ID NAme      Marks
    1 # A     #     10
    1 # A     #     20
    2 # B # X
    3 # C # 12
    4 # D # X

    Or, using ANSI join syntax:
    with Table1 as (
                    select 1 id,'A' name from dual union all
                    select 2,'B' from dual union all
                    select 3,'C' from dual union all
                    select 4,'D' from dual
         Table2 as (
                    select 1 id,10 marks,'Y' display from dual union all
                    select 1,20,'Y' from dual union all
                    select 1,14,'N' from dual union all
                    select 2,12,'N' from dual union all
                    select 2,13,'N' from dual union all
                    select 3,12,'Y' from dual
    -- end of on-the-fly data sample
    select  t1.id,
            name,
            nvl(to_char(marks),'X') marks
      from      Table1 t1
            left join
                Table2 t2
              on (
                      t2.id = t1.id
                  and
                      display = 'Y'
      order by id
            ID NAME                                                    MARKS
             1 A                                                       10
             1 A                                                       20
             2 B                                                       X
             3 C                                                       12
             4 D                                                       X
    SQL> SY.

  • Help with conditional hyperlinks

    Hi all. I need some help creating a link that goes to a page depending upon a variable in a database. Here is sample code I am trying to make work:
    <cfquery ""
    <cfquery name="rsgetAvailable"
        datasource="name" username="name" password="pw">
        SELECT variable
    FROM table
    </cfquery>
    <cfset variable eq "">
    <cfif variable eq "on">
    <a href="http://360buyers.com/threesixty/studentrentals_Search.cfm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('SearchbyListing','','../Artwork/By Listing_Over.png',1)"><img src="../Artwork/By Listing_Live.png" alt="Search by Listing" name="SearchbyListing" width="250" height="150" border="0" id="SearchbyListing" /></a>
    <cfelse>
    <a href="http://360buyers.com/threesixty/studentrentals_Search sa.cfm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('SearchbyListing','','../Artwork/By Listing_Over.png',1)"><img src="../Artwork/By Listing_Live.png" alt="Search by Listing" name="SearchbyListing" width="250" height="150" border="0" id="SearchbyListing" /></a>
    <cfif>
    Seems like this should work but is does not.
    Can anyone help by identifying the problem(s)
    Thank you much

    You've got a typo-error and forgot to close the ending cfif tag; you forgot the slash </cfif>.
    I prefer to use integer or boolean values in this case instead of strings but it should work if you've string variable too.

Maybe you are looking for

  • Synching iMovie in Logic Express

    Hi All, I'm trying to record an iMovie of a final vocal track of a logic express audio project. I can record the audio portion of that track in Logic, but I can not figure out how to synchronize the iMovie component. What is the easiest way to "move"

  • DW on Mac, CS3/CS5 using SFTP and/or FTP, need it secure!

    Folks: DW CS3 or CS5 running on an quad-Intel iMac, 10.6.4, connecting to a host that uses identical credentials for SFTP and FTP. It's important to be assured that the connection is in fact secure. If you set  "connect using SFTP" will DW CS3 compla

  • Macbook Pro with retina display : GPU bottleneck?

    The new exciting MPB with retina doesn't offer any upgrade for the most powerful Nvidia Geforce GTX 680M. Do you think the actual 650M would be a bottleneck? Just checked some benchmarks at http://community.futuremark.com/hardware/gpu/NVIDIA+GeForce+

  • Cannot download from the 5DMark 3 with cord to Lightroom 5.

    Up until tonight I could always download directly from my Canon 5D Mark III to Lightroom 5.  Now with Lightroom Import it is freezing and not showing the files.  My card reader was always too slow and generally the USB cord was very efficient.  Can s

  • Tascam US-600 isn't working, works with GarageBand.

    Anybody else use the Tascam US-600 input and have issues in MainStage? I use it with GarageBand and have zero problems, but I get nothing in MainStage. In MainStage's preferences it acknowledges that it's there and I can select it as an input, but I