Validate input value against calculated value

Hi Chaps,
Need a bit of guidence with some PHP code.
I have a Query that estimates a quote ($price_total) for a job.
The estimate ($price_total) is the value of an input (jobquote), and the database is updated once the form is submitted (using a seperate script.php page).
What I need, is to validate the entered value of 'jobquote' against the estimated value of $price_total, just incase a 'custom' price has been agreed with a customer.
If the values are different, then I need an 'admin override' radio button (admin_quote enum('y','n')) to appear.
If someone can help or point me in the right direction, I'd be most grateful.
Cheers

Got a bit further:
PHP Code:
<input type='text' name='jobquote' value="<?php echo $price_total; ?>"/>
        <input type='hidden' name='original_jobquote' value="<?php echo $price_total; ?>"/>
        <?php
if ($_POST['original_jobquote'] != $_POST['jobquote'])
{ ?>
<span id="spryradio1">
<input type="radio" name="jobquoteadmin" value="y" id="radio" />Confirm<br />
<span class="radioRequiredMsg">Please confirm Admin Override</span></span>
<?php };
?>
Problem 1. The information is '$_POST'ed to a script file, not to the page itself and at the moment, the $_POST takes place before the PHP validation takes place. If I remove the link to the script page, the validation works.
Problem 2. (link to script removed for testing) If I change the value (from the default 'original_quote'), then submit, the page reloads, the 'Confirm' radio button appears, but the value of 'job_quote' has reverted back thte default:
1. Start - job_quote = £350
2. Change - job_quote = £100
3. Submit
4. Page reloads - job_quote = £350, confirm appears
Is there a way around this?

Similar Messages

  • Function module to validate input value

    Hi all,
    can you please provide me the name of the function module to validate input value.
    I have a case where i have to validate decimal values. sometimes users may enter wrong decimal values by mistake instead of  "0.23" "0..23' and it gives CONVT_NO_NUMBER runtime error so have to come up with some solutions to validate user input.
    Please provide me Function module if anybody knows.
    Thanks,

    Try this one
    data: lv_htype TYPE dd01v-datatype.
        CALL FUNCTION 'NUMERIC_CHECK'
          EXPORTING
            string_in = my_number
          IMPORTING
            htype     = lv_htype.
        IF lv_htype NE 'NUMC'.
           Raise an error here...
        ENDIF.

  • Validate input value against database

    Is it possible to check the value of an input field (regular input, not cfinput) against a database to check for duplicate values?

    Probably.

  • Formula Variable to Validate Input Values

    Hi experts,
    I created a query with some exceptions which uses formula variables to validate these exceptions. But I have a requirements for these formula variables. Eg: Certain user can only enter the selection range of values 1-50 for this formula variables during the run time, if the user enter the values more than > 51, the user will not be able to see the report results and the query will show message saying that the user is not authorized to see the results with this selection. And certain user will be able to see the report results for selection values more than 51.
    Any idea of how to achieve this? I planning to create a customer exit but I do not know what code to use here.
    Thanks alot.

    Just now i noticed that even wtih user hooks, it is not feasible: Please validate my approach is correct or not.
    i used query:
    select api_module_id, module_name, module_package
    from hr_api_modules
    where module_name like '%ELEMENT%ENT%';
    API_MODULE_ID MODULE_NAME MODULE_PACKAGE
    78 CREATE_ELEMENT_ENTRY PY_ELEMENT_ENTRY_API
    79 UPDATE_ELEMENT_ENTRY PY_ELEMENT_ENTRY_API
    80 DELETE_ELEMENT_ENTRY PY_ELEMENT_ENTRY_API
    178 PAY_ELEMENT_ENTRIES_F     
    but .. i dont see any hook record for api_module_id = 78 in hr_api_hooks table.
    select *
    from hr_api_hooks
    where api_module_id = 78;
    -- No Records for above Query.
    My conclusion is, we cannot register our custom package with PY_ELEMENT_ENTRY_API.create_element_entry module.
    Please validate my conclusion is correct or not.
    if this is correct, It is really unfortunate that, i cannot implement this simple validation.
    Message was edited by:
    user552453

  • I need to validate Input List Of Values Field when Inserted From Bean

    I've two view object EmployeeView and DepartmentsView
    In Employee View I've changed Department_Id to Input List OF Values
    I've created a bean to inset data into Employee Table
          ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
          ViewObject importedVO = am.findViewObject("EmployeesView");
    try {
                newEmp.setEmployeeId(new Number("3424));
                newEmp.setFirstName("Test Fname");
                newEmp.setLastName("Test Lname");
                newEmp.setEmail("[email protected]");
                newEmp.setPhoneNumber("4643131345");
                newEmp.setJobId("AD_VP");
                newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));
                 } catch (Exception e) {
                // TODO: Add catch code
                System.out.println("inside Catch");
                e.printStackTrace();
            }I know that ADF validate Input list of values when inserting new value on it
    when I've enabled the debugger I've found that
    <ViewObjectImpl><buildQuery> [604] SELECT DepartmentsEO.DEPARTMENT_ID,         DepartmentsEO.DEPARTMENT_NAME,         DepartmentsEO.MANAGER_ID,         DepartmentsEO.LOCATION_ID,         DepartmentsEO.ISDELETED FROM DEPARTMENTS DepartmentsEO WHERE ( ( (DepartmentsEO.DEPARTMENT_ID = :vc_temp_1 ) ) )
    <ViewObjectImpl><bindParametersForCollection> [605] Bind params for ViewObject: [com.test.model.views.DepartmentsEOView]AppModule.__LOCAL_VIEW_USAGE_com_test_model_views_EmployeesEOView_DepartmentsView_findByVC_12_LOV_DepartmentId_lov__filterlist__vcr___
    <OracleSQLBuilderImpl><bindParamValue> [606] Binding param "vc_temp_1": 999
    <ViewObjectImpl><processViewCriteriaForRowMatch> [607] VCs converted to RowMatch:  ( (DepartmentId = :vc_temp_1 ) )
    <ViewRowImpl><handleListBindingMismatch> [608] No matching row found for list binding:LOV_DepartmentId for ViewRow:oracle.jbo.Key[34235 ]
    <ViewRowImpl><handleListBindingMismatch> [609] --- filterList ValueMap key:DepartmentId, value:999
    <DCBindingContainer><internalRefreshControl> [610] **** refreshControl() for BindingContainer :com_test_view_testInsertPageDef
    <JUCtrlHierNodeBinding><release> [611] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_2, value:EmployeesViewIterator
    <JUCtrlHierNodeBinding><release> [612] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_2, value:EmployeesViewIterator
    <DCIteratorBinding><releaseDataInternal> [613] Releasing iterator binding:EmployeesViewIterator
    <ApplicationPoolMessageHandler><doPoolMessage> [614] **** PoolMessage REQ ATTACH LWS
    <ApplicationPoolMessageHandler><doPoolMessage> [615] **** PoolMessage REQ DETACH LWS
    <DCJboDataControl><initializeApplicationModule> [616] (oracle.adf.model.bc4j.DataControlFactoryImpl.SyncMode = Immediate
    <DCBindingContainer><internalRefreshControl> [617] **** refreshControl() for BindingContainer :com_test_view_testInsertPageDef
    <DCBindingContainerState><validateToken> [618] Process BindingContainer state token(decompressed state):BCST:=0%V%=NEmployeesViewIterator=-D-,
    <this means that ADF tries to validate the input list of values "Department_Id" and didn't found any match
    I need to through exception when I try to set Department_ID with invalid value "value not on range" like
    newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));I don't want to validate it manually as I've a lot of fields.
    I need to through exception when try to
    newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));

    Thanks Timo
    this is the code that I use
          ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
          ViewObject importedVO = am.findViewObject("EmployeesView");
          EmployeesEOViewRowImpl newEmp = (EmployeesEOViewRowImpl)importedVO .createRow();
          importedVO .insertRow(newEmp);
    try {
                newEmp.setEmployeeId(new Number("3424));
                newEmp.setFirstName("Test Fname");
                newEmp.setLastName("Test Lname");
                newEmp.setEmail("[email protected]");
                newEmp.setPhoneNumber("4643131345");
                newEmp.setJobId("AD_VP");
                newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));
                 } catch (Exception e) {
                // TODO: Add catch code
                System.out.println("inside Catch");
                e.printStackTrace();
            }

  • How to validate the values inputted in Salestext view at MM02 before saving

    Hello All,
    Does anyone know what FM or user exit to use in order to validate the values inputted in Salestext view at MM02 transaction before saving it.
    Regards,
    Alfred

    Hello,
    Find the user exits if any after finding keep the break point in the exits and check that cursor is trigrring that exit or not. If it triggers check the value of the salestext exits in the exporting parameters or not.
    if exits then keep do the validations.
    UserExits MM02
    MGA00001            Material Master (Industry): Checks and Enhancements
    MGA00002            Material Master (Industry): Number Assignment
    MGA00003            Material Master (Industry and Retail): Number Display

  • Validate field value against LOV in JClient

    Hi,
    I have wondered is it possible when i have a LOV attached to a textfield or column from JTable to validate entered value against values in LOV. I mean when i enter wrong value in field, automatically to invoke LOV panel when the field lost focus.
    Thanks in advance!

    Hi,
    this is currently not a feature available in JClient. We are evaluating this as a new feature in a next version fo ADF JClient (which will be named ADF Swing then)
    Frank

  • Validate a value against table validation value set within PL/SQL

    Hi,
    I am trying to import price list lines along with Pricing attribute values.
    I have to validate the uploaded values against the pricing attribute value set, before I import them into base tables.
    Value set defined is of type table validation.
    I wanted to know if there are any public APIs that can be used to validate the value against the Value set values within my PL/SQL procedure
    Also please point me to documentation that lists various public PL/SQL APIs
    Regards,
    Mrutyunjay

    You can find functions and procedure for Value sets in packages FND_FLEX_VAL_API or FND_FLEX_VAL_UTIL.
    Example : get_table_vset_select gives you the select statement of your value set. Executing this statement will allow you to validate your values.

  • Function Module to validate a value against domain fixed values

    Hi,
    Could anybody please let me know if there is a standard Function Module that takes a Value and Domain name as an input and checks if the input value exists in the Fixed Values of the domain.
    Thanks,
    Shalabh

    Hi,
    you can use fm FM_DOMAINVALUE_CHECK. Pass parameter values for I_DOMNAME and I_DOMVALUE.
    If the value is invalid, exception VALUE_NOT_ALLOWED will occur.
    Regards,
    Klaus

  • Text Entry Box--Advanced Actions--Conditional Statement--Double quotes in literal input value

    Hello forums,
    I'm new to the forums (and Captivate in general), but I'm having a real problem carrying out a tutorial design and I think you may be my only hope.  Let me explain what I want to do and the difficulty that I'm having:
    I'm an instruction librarian at a university, and I'm designing an interactive tutorial for English 100 students to complete in order to become familiar with how to search the library catalog.  What I've done is taken a screenshot of the catalog search page, made it the background of a slide in Captivate (vers. 6), and placed a text entry box over the search bar in the screenshot.  The idea is for the students to conduct a simulated search by choosing one of three suggested search string formulations, and depending on the search string they enter, the tutorial will jump to a slide featuring a screenshot of what the actual search results would look like.  The idea is to emphasize the use of keywords over full-sentence phrases, and the use of double quotation marks to enclose multi-word search terms.
    So I've set the action for the TEB to "Execute Advanced Actions" and then created some IF/THEN statements in the "Advanced Actions" pop-up window (with action type set to 'conditional'). The script is such that if the student enters the first search option (how does sleep affect college students) in the TEB, the tutorial jumps to 1 slide, if they enter the second option (college students AND sleep), featuring a Boolean operator (AND), the tutorial jumps to a 2nd slide, and if they enter the third option ("college students" AND sleep) with the double quotes around "college students" and the Boolean operator, the tutorial should jump to a 3rd slide.  This action script works fine for the first two input options, but I can't make it work for the third search option.
    I think that it has something to do with the fact that the third input option features double quote marks, and this seems to throw off the script (I tried a quote-less input value for the third IF/THEN just to make sure that it would work jumping to the 3rd slide and it did), and I'm wondering if anyone has any suggestions as to how I can get around this issue.  Again, I need it to work so that if the student enters "college students" AND sleep, with the quote marks and the Boolean operator, the tutorial will jump to a slide showing the search results if those search terms were used in a real search of the catalog.
    I'd be extremely grateful for any help that anyone here can give me, we've been trying to make our online tutorials more engaging and interactive (and therefore more interesting), and I think this would be a great way to teach students about using quotes in their catalog searches.
    Thank you for your time and consideration.
    Andrew Wilk
    College Library
    UW-Madison

    The tutorial is for a "how to use catalog searching" instruction in an undergraduate library session.  We use boolean operators (AND, OR, NOT) to combine search terms, ex. to search for books about the sleeping habits of college students, I would enter "college students AND sleep."  Because "college students" is a multi-word phrase to describe one concept, I need to put quotation marks around the phrase to prevent the catalog from searching for the individual words separately, so the most correct search becomes ["college students" AND sleep] with quotation marks around only "college students," a user-typed "AND," and the word "sleep" (no q-marks).
    A colleague of mine worked out a pretty cool (if complicated) solution that I'll share if anyone is interested.  Since the q-marks where the problem, we've set it up so that the TEB validates the response for the search string with q-marks around "college students." If they enter it correctly, the tutorial jumps to the corresponding slide. The attempt # is set to 1, and if the user fails to enter the validated phrase (they misspell or use one of the other response options) then the TEB is set to run an Advanced Actions Script in which the other two options are scripted in IF/THEN statements that cause, when the term is entered correctly, the tutorial to jump to their corresponding slides. We've created another tab of IF/THEN statements that say that if the response is NOT equal to one of these response options, then the slide restarts (technically the slide "jumps" back to itself and starts over) and the user gets another chance to start the cycle over again.
    I know this is confusing (I had a really hard time explaining it in words), so if anyone is interested I could make a Jing video when I have some time.
    Thank you for all your suggestions

  • Unable to enter Input value for an ICD

    Hi All,
    I have created an element XXX which has two input values "Pay Value" and "Class". The class has the values 'A','B','C','D'. I have created a plan and set up the rate In the calculation method I have chosen "No Standard values used".
    Now when I try to assign this ICD plan to the user in the Miscellaneous plan I am not able to enter the car class. Can someone help me with this.
    Thanks
    Shekar.

    Hi Shekar
    I find the ICD setup very 'picky'! If you get one thing wrong, it doesn't work. I have detailed below the steps I usually advise people to tek. Check your setup and see if this helps.
    1. Define Plan Type, Compensation Category = Others.
    2. Define Plan. Link to Plan Type. Plan Usage = May not be in program. On Not in program Tab - define sequence, currency, enrollment rate (per pay period?), activity reference period (Monthly). Your settings may need to be different. On Plan details tab, enter plan years.
    3. Plan enrollment requirements. On the general tab, plan sub tab, make sure the method = EXPLICIT. this allows the user to enter an input value for the ICD. THIS MAY WELL BE THE SOURCE OF YOUR PROBLEM!
    Make sure the CERTIFICATION region is UNTICKED. This can also cause ICDs not to work.
    ALLOWS UNRESTRICTED ENROLLMENT must be TICKED. Otherwise there is no eligibility to the ICD.
    On the rates subregion, make sure the run strt date is set to ENTERABLE.
    4. standard Rates form. Make sure the ACTIVITY TYPE and TAX TYPE are entered. Select the ELEMENT and the INPUT VALUE and TICK the ELEMENT AND INPUT VALUE REQUIRED field.
    On the processing Information tab - TICK ASSIGN ON ENROLMENT, DISPLAY ON ENROLLMENT and PROCESS EACH PAY PERIOD. Enter PER PAY PERIOD AMOUNT in VALUE PASSED TO PAYROLL and OTHER in COMPENSATION CATEGORY.
    Let me know if this works!
    Regards
    Tim

  • How to capture the User input value to user exist function module.

    Hi,
    How can i capture user input value.Here i am using User exist in BPS variable.
    Calculating days using user exist functin module and my input is another variable i.e user defined value.
    How can i capture user defined vaule into my function module.
    This is very urgent can you help me..
    Thanks....

    Hi!
    You can get the instance using the method get_instance of the class cl_sem_variable, and call the method get_value with the return. Check the example:
          CALL METHOD cl_sem_variable=>get_instance
            EXPORTING
              i_area       = (planning area)
              i_variable   = (variable name)
            RECEIVING
              rr_variable  = lr_var
            EXCEPTIONS
              not_existing = 1
              OTHERS       = 2.
          CHECK sy-subrc IS INITIAL.
          CALL METHOD lr_var->get_value
            RECEIVING
              rto_value = et_value
            EXCEPTIONS
              error     = 1.
    After this, read the first line of the table et_value (it should be the value that the user choose on the screen).
    seeya!
    Robson

  • WAD 2 queries with 1 input values taking for only 1 query.

    Hi Gurus,
    Can anyone please tell me. I am working on a report 2 queries in WAD and 1 variable / input screen before running a report & 1 variable screen or filter pane after running a report. So 1.filter pane on top 2. chart (1st query) between 3. Analysis pane (2nd query) at bottom.
    Problem here is when we give input values on variable screen or input screen in WAD it is taking that as an input & applying on 2nd query (analysis pane) where it is not applying on 1st query so 1st query is showing all values & 2nd query is showing values that are given as input & filter pane is showing values that are given as input in variable screen.
    Here affected data providers is checked for both data providers. can anyone please tell me what would be the problem or how can i make input screen effect on both queries.
    Thanks in advance.

    Hi Sudheer,
    Is the same variable being used across both the queries with all settings etc the same? In WAD web template settings, you can uncheck 'Display same Variables for different queries only once [MELT_VARIABLES]' & check if you see the same variable twice. Try entering the same value against both & check if the Chart qry gets affected.
    --Priya
    Edited by: Priya Jacob on Oct 1, 2010 6:22 AM

  • Make Element Input value Mandatory

    Hi All ,
    I have created an earnings element with calculation rule as "HoursxRatexFactor" . The element works fine when attached to any employee . But I want to make the "Rate" input value as mandatory . I went into "Element Description" screen and then to input values screen , but I find that the required check box is greyed out and we cannot update it . Is there a way to make the input value as mandatory . Any help is of great help !! .
    Thanks for your time & attention,
    Chandu
    Edited by: Chandu_CS on Aug 28, 2009 1:24 PM

    Please create earnings elements through Total Compensation -> Earnings option. There you shoulb be able make Rate as required field, if element is new and hasn't been processed yet.

  • OTL Timekeeper Form Custom Field map to specific Element Input Value

    Hello Everyone,
    I have the below requirement.
    1. Create a custom field in OTL Timekeeper Form. This field is based on the Element Selected on the timecard.
    2. Once the Timecard is transferred to Payroll, the custom field should go to a specific input value of that element.
    I know how to perform Step 1 above. But i am unable to find out how i can map the value in custom field to a specific Input value of the element.
    Any inputs are appreciated.
    Regards,
    Jay

    Any tips people?
    Can this be achieved?
    This is what i have done so far.
    1. Created a new Value set for the custom field.
    2. Created an alternate mapping to map the value set value to InputValue13.
    3. Created the alternate name.
    4. Added the alternate name to 'OTL Alternate Names' DFF.
    5. Added the Alternate name to the 'Preferences'.
    Testing:
    1. Created a Timecard populating the custom field.
    2. Timecard submitted and approved successfully.
    3. I verified that the custom field value goes into attribute13 of hxc_time_attributes where the attribute category is the corresponding element (should it be against the attribute category: Dummy Element Context? If Yes, then how to do it?).
    4. Then i ran the program 'Transfer Time from OTL to BEE'. This transferred the values into hxt_timecards_f, hxt_sum_hours_worked_f, hxt_det_hours_worked_f. But nowhere in these tables do i see the custom value.
    Did i miss any step? I did not define anything in the 'Define Mapping Components' of Deposit/Retrieval Process because InputValue13 is already part of it unter type 'Dummy Element Context'.
    5. Since it is not in hxt tables, i did not find it in pay_batch tables too.
    Any guidance is appreciated.
    Regards,
    Jay

Maybe you are looking for

  • Printing Reports directly from to a printer via 10g forms (Linux)

    Hi all, I need to be able to print Reports directly from a form to a printer (bypassing the form output) on Linux (RHEL 5). The trick here is this is Linux, not windows so, wasn't sure how to deal with printers in this case. I have the option working

  • Error 500 AND 'No principal found for UID:' problems

    Hi, We are having problems familiar to what I read on this forum. First, the log-file mentions lots of times: 'No principal found for UID:blabla', with some lines following it. Second, we get error 500 when setting the delegates or even looking at it

  • Change Row - to Column

    Hi all, Oracle table A with fields companycode,Locid,suppid,supptyp .100 records for each company,locid combination, but in VSAM file we have to load into a single record with 100 occurances in table Companycode1,locid1,supp1,supptyp1 Companycode1,lo

  • Where's Bridge on my Mac?

    I can't find Adobe Bridge on my Mac. I'm a subscriber to Creative Cloud (CS6). When you use the Adobe Application Manager to download all of the respective apps from the Cloud, Bridge is not there, although, supposedly, it comes in with either Illust

  • Hierachy in the report incuding previous periods

    Hi, guru. I have a problem with my report which based on the info-set. This info set consist of: 1. Info cube Z_CUBE 2. Info-provider Z_OLD_OE with time-dept. navigation attribute 0ORGUNIT 3. Info-provider 0ORGUNIT with some attribute Z_ATTR and time