Struts and ajax for input validation check

Hi there
I am not quite sure where I should post this question. I have a question about using ajax to check input valudation check on a jsp page which uses struts tab libs.
For example, I want to check if input email has already existed in the database on the sign up page. If it is, a sameEmail jsp page will through out in the span area. Meanwhile, the form on this page should not be allowed to submit.
Email test field
<div><html:text property="email" onkeyup="showHint(this.value, 'hint', 'errors/sameEmail.jsp')"/><span id="hint"></span></div>There are two strateies in my mind
Strategy 1. Disable the submit button when sameEmail.jsp is throwed out.
I named all buttons operation in sign up page, so LookupDispatchAction page can process all the logical work depends on the value of these buttons. My questions is how I can disable signup submit button in javascript, as I need use this element id or name? Apperantly, I cannot add id into Strut 2 jsp page, plugs all buttons' names are the same on the sign up page.
For example:
     <html:submit property="operation">
          <bean:message key="adminMainForm.signUpButtonLabel"/>
     </html:submit>
<html:submit property="operation">
     <bean:message key="adminMainForm.deleteAll" />
     </html:submit> Strategy 2. Write something in the js page, which will block the data transfer.
Something similar to
function validateSignupInput(form) {
if(form.customerEmail.value.exist()){
return false;
} Appearntly it doesn't work.
My question is that how I can write this piece of js code.
Any idea will be helpful, thank you.
Ming

Hi Karan,
I did not get ur requirement but if the question deals with selection screens, I have an answer for it.
before u do all these things, first you need to trigger an event called AT SELECTION-SCREEN.
example code is :
AT SELECTION-SCREEN.
    IF (fld name) > (value)   -
> any logic which u need
           message
   endif.

Similar Messages

  • How to extends JSpinner to check for input validation.

    I have JSpinner instantiated with a SpinnerNumberModel. If I enter a number for example 123 I am happy with it. However if enter 12a3, I would like the spinner to the notify the user of the error, instead of parsing the number to just 12.
    Thank you.

    The text component of a JSpinner that uses numbers is a called a NumberEditor and is an inner class of JSpinner. You can read the API here
    It uses a JFormattedTextField to accept input, and you would do well to read the API on this as well. You may need to substitute a plain JTextField with a DocumentListener, but I haven't tried this so can't fully vouch for this.
    oh, and as always, please simply ignore alexxzius.
    Edited by: Encephalopathic on Jul 4, 2008 11:25 AM

  • Event for input validation in custom table (table maintenance generator)

    Hello all,
    I look for a solution to execute an event after the modification of a table field of a custom table to validate the user's input.
    I already tried event 07 (Execution : Before correcting the contents of a selected field) of the table maintenance generator but it will be executed after some modification made by the Edit -> Change field action.
    I could use the event 01 but in my opinion this event happens to late and errors are very uncomfortable for the user at that time.
    Editing the dynpro events is not a solution for me because it should be easy to maintain the table structure at any time.
    Thank you in advance
    Robert

    Thank you!
    Event 08 just starts after the saving process after Event 07.
    Event 18 gets executed when I click on the save button.
    I want to check the data after the enter button was pressed as you can see it in several transactions.

  • EL and quotes for input value

    In my Tomcat 6.0.20 container, I have a form value that works great except if the user enters quotes in the form input. Anything in quotes wont show up.
    For example if they enter: Here is the "info"
    The form value would only show: Here is the
    Input example that wont work with quotes:
    <input type="text" name="city" value="${dataBean.city}" />If I use tick instead of quotes it works and shows anything in quotes:
    <input type="text" name="city" value='${dataBean.city}' />Please advise why this is happening and if there is an alternate solution to this issue?

    Evergrean wrote:
    In my Tomcat 6.0.20 container, I have a form value that works great except if the user enters quotes in the form input. Anything in quotes wont show up.
    For example if they enter: Here is the "info"
    The form value would only show: Here is the
    Input example that wont work with quotes:
    <input type="text" name="city" value="${dataBean.city}" />If I use tick instead of quotes it works and shows anything in quotes:
    <input type="text" name="city" value='${dataBean.city}' />Please advise why this is happening Check the generated html page source code.It should explain the behavior.
    and if there is an alternate solution to this issue?Try using out tag. For eg:
       <input type="text" name="city" value='<c:out value="${dataBean.city}"/>' />

  • Report and ready for input Query, with similar shadings are confusing

    Some customers mix report and planning queries in their templates.
    usually the shades for PLAN Queries are
    o white - ready vor input
    o blue- display data (e.g. LY, calc KPI)
    In a Query with NO INPUT ready Cells the query has a zebra shading, blue and white, row by row.
    That is confusion for users if they believe every Number on a white background can be changed.
    Is it possible to change the shading for reporting queries to blue only?
    Best Regards,
    Georg

    Hi.
    You can cancel zebra by setting off for ALTERNATE_STYLES in properties if analysis item in WAD, BUT it sets all cells as WHITE and not blue.
    I dont know how it will be usefull, but you may try ...
    Regards.

  • Error  handling  for input  validations

    hi,
    Problem:I'm writing  FM  for the material plant details  on inputs material and plant.
                       if  material is not valied  and i need to show  error messages
                        if material is not in plant  then it shows relevent Error messages
                       i need to handle all  possiable  error messages.
    Requirement:I need standard  FM  to handle any type of error messages that will eraise,
                       that i need to show.
    could anyone tel me any standard FM to handle any type Error messages.
    Thanks in Advance.
    sivakumar

    Hi siva,
    In the past I have used the following function modules to handle multiple error messages;
    1.
      CALL FUNCTION 'MESSAGES_INITIALIZE' "To initialise the storage table
        EXPORTING
          collect_and_send   = ' '
          reset              = 'X'
          line_from          = ' '
          line_to            = ' '
          i_store_duplicates = ' '
          check_on_commit    = 'X'
          i_reset_line       = ' '.
    2.
      CALL FUNCTION 'MESSAGE_STORE' " Use to store each message one by one as they occur
        EXPORTING
          arbgb                  = p_msid
          msgty                  = p_tipo
          msgv1                  = p_var1
          msgv2                  = p_var2
          msgv3                  = p_var3
          msgv4                  = p_var4
          txtnr                  = p_txtnr
        EXCEPTIONS
          message_type_not_valid = 1
          not_active             = 2
          OTHERS                 = 3.
    3.
      CALL FUNCTION 'MESSAGES_SHOW' " Use at the end to finally display the messages
        EXPORTING
          object             = text-004
          send_if_one        = 'X'
          i_use_grid         = 'X'
        EXCEPTIONS
          inconsistent_range = 1
          no_messages        = 2
          OTHERS             = 3.
    I hope this will help you.
    Regards,
    Simon

  • Instance name and Var for Input Text fields

    I have several Input Text fields, as a form, linked to a PHP
    script for which I require Var's for each field.
    But I also need Instance names for each field, so I can fix
    the tabIndex.
    Yet, everytime I test my movie, the text fields have their
    Paths (_level0.fName) written in them.
    They are normally blank, and I've tried putting in some text
    of my own, but the Var name is still displayed in the text fields.
    Is there any way I can stop that from happening, and keep
    both the Instance names and Var's in-place.
    As far as I know, I need both the Instance name (for the
    tabIndex) and the Var (for the PHP script) or is there a way that
    the tabIndex and PHP script will work with either of the two?
    Thanks
    Chaz.

    Can you use a different name for ‘instance name’
    and ‘var’? That seems to solve the problem but I
    don’t know if that helps you in your situation.
    For an example;
    Instance name: test_txt
    Var: test

  • WADL generator and $ signs for input parameters

    Hi,
    I'm using the WADL generator for my REST services, but my parameters require a '$' in front of them, for example $format=json.
    But the WADL generator gives me an error = 'Id must contain only letters with no spaces'.  I wouldn't mind it if I could just change the parameter in order to generate the WADL and then adjust the WADL with the '$'s I would need, but it won't progress
    to the generation of the WADL without the URL working......which it can't without the '$' for my parameters.
    Any way of getting around this?
    Cheers,
    JB

    Hi JB,
    This is a known issue with the WADL gen tool which we plan to address in a future release.
    In the meantime, you can add your parameter (omitting the '$' sign) and instead of hitting "Try It" to get the tool to download the json string on your behalf, you can manually paste the json response into the text box - this will generate the
    correct WADL grammar for the WADL file which you then could add the '$' once the WADL is generated.
    Thanks!
    Justin

  • Validation check for an item

    I am not sure about how to use regular expression for a validation check for an Item
    I might need to check for an item for the below format -
    1 , XXX-XXXXX-## ( "3 alphanumeric" , "middle score" , "5 alphanumeric" , "2 digit year" )
    2, XX##-### ("2 alphabets ", "2 digit number", " middle score ",3 digit number

    Lucy,
    Create an item level validation of type regular expression, and use the following for the respective Regular Expression values:
    1) ^[[:alnum:]]{3}-[[:alnum:]]{5}-[[:digit:]]{2}$
    2) ^[[:alpha:]]{2}[[:digit:]]{2}-[[:digit:]]{3}$I'm only very new to regular expressions, so I welcome being corrected if there's a more efficient way of declaring this. But this works.
    Anthony.

  • Input validations using bsp code

    hai all,
       i want to check user input whether he/she entered correct values r not, i know how to do using javascript.
    but i need to do the same without using javascript.. is there any way
    leoiz

    No, this was not a joke, but it would be possible theoretically.
    Doing a quick search on Google got me this nice link:
    http://www.permadi.com/tutorial/flashjscommand/
    It shows an example of Flash interacting with JavaScript, hence proving the possibility.
    As for really using Flash/ActionScript for input validation ...
    If you are thinking about just including a little Flash-Validation for input fields - why do it with Flash if you can use JavaScript?
    And if your page is a Flash-Page anyway, well, you would not have to go back to HTML input fields, as you work within your Flash applet.
    Maybe you have a specific situation I didn't think of yet.
    Max

  • SAP: HR/ABAP Pan Card Validation check in PA 30 (Subtype : 185)

    Hi Gurus,
    I am trying to implement BADI : ZHRPAD00INFTY for a validation check over the screen field  p0185-icnum.
    Pan must be of 10 digits .
    First five digit and tenth digit must be alphabet(A_Z)
    Sixth to Ninth digit must be Number (0,1,2,3,4,5,6,7,8,9)
    Fourth digit of Pan represent Assessee status,and if a Partnership firm provides pan with forth digit as P or C then it means the pan is incorrect
    Fifth Digit of Pan represent Surname as per Data filled in the application in case of Individual assessees and in other case first name .
    I require an assistance with code.
    Regards.

    Thank you always learner. Here is my working code in BAPI.
    IF new_innnn-infty = '0185'.  " Pan Card Check
    * screen field: P0185-ICNUM
         DATA: v_icnum TYPE i.
         DATA: text TYPE string,
            moff TYPE i,
            mlen TYPE i.
         FIELD-SYMBOLS : <fs_pan> TYPE any .
         ASSIGN ('(MP018500)P0185-ICNUM') TO <fs_pan>.
         v_icnum = strlen( <fs_pan> ).
         IF <fs_pan> IS NOT INITIAL AND v_icnum = '10' .
           FIND REGEX `[A-Z]{5}\d{4}[A-Z]{1}`
           IN <fs_pan>
              IGNORING CASE
              MATCH OFFSET moff
              MATCH LENGTH mlen.
           IF sy-subrc NE 0.
             MESSAGE e398(00) WITH 'Please Enter Valid Pan No.'.
           ENDIF.
         ELSE.
           MESSAGE e398(00) WITH 'Please Enter Valid Pan No.'.
         ENDIF.
       ENDIF.

  • Comparision btw Struts and JSTL tags

    Hi,
    Is there any article or helpful information that any body have come across that have good comparision between struts and JSTL tags? I am trying to find similar JSTL tags to my struts application.
    Any help in this regard is appreciated.
    Thanks,
    -jon

    You can't use JSTL to replace struts completely. The struts tags and the JSTL tags have some overlap in the logic, control flow and formatting bits, but there is a lot that struts does that JSTL doesn't (the input controls).
    Struts-el was a bridge between Struts and JSTL for JSP1.2 containers.
    It has a very limited use nowadays. Most applications should be being written in J2EE1.4 (Servlet 2.4/JSP2.0), and thus the requirement for the struts-el tags is not there - the container understands EL without special tags required.
    As I said before you should only use Struts-EL if
    - You are stuck with a J2EE1.3 (Servlet2.3/JSP1.2) container
    - You want to use EL with struts.
    For myself, I prefer using the EL expression like ${expr} rather than older <%= expr %>, but it comes down to personal preference.
    Cheers,
    evnafets

  • Authorization Variables ready for input

    I have a problem whit a variable, is an authorization variable and ready for input, but when i use this variable and clean the input box this variable don't works as an authorization variable...
    I hope that this variable return all the values where the user has authorization but it return ALL values and not only where the user is authorized...
    How can I make that a blank variable gives me all the values the user is authorized to see?
    Hope someone can help me!
    Best regards
    Enrique

    Steps that you may be missing:
    1. Make the info object authorization relevent. You make this setting in info object maintenance screen -RSA1 .
    2. Create a authorization objects in RSSM for this object.
    3. Maintain values for this object in PFCG for the role that you  assign  to the users.
    After that, run the query.
    Ravi Thothadri

  • Conf operation 10 for GI and 20 for GR

    HI PP guru,
    in routing there are two operation 10 and 20 , at the time of confirmation (Co11n)  material movement  only GI for operation 10 and  GR for (101) for operation 20
    operation 10 only for GI (261 mvt type)
    and operation 20 for GR ( 101)
    .i have maintain control key PP01 ( with automatic  GR) for operation 10
    and for operation 20  control key PP03 ( with auto GR and mile stone confirmation)
    when i do confirmation operation 10 material comes for 261 which i have  assigned to operation 10.
    but when i do operation 20  confirmation co11n  and go in material movement  does not come any material for GR ( 101)
    but requirement is  operation 10 for GI and operation 20 for GR
    what should i do? how
    Note : when i keep one operation 10 in routing all GI and GR  ( 261 and 101) materials comes.
    Regards
    aqueel

    Dear
    Please note that Operation Control Key -PP03 in standard has Auto GR active and it can be used only in the Last Operation in any production order if you want to avoid manual MIGO-101 or want to have Auto Goods Recipt .
    In you case , you should not use a control key which has Auto GR active except last operation .I think PP01-Control key doe not have Auto GR active in SAP Standrad  and in case if you mark the same , then un-checked that functionality in Define Control Key under Shop floor control .
    Now if you want only GI at Operation 10 , then in CA02-Goto Operation -Select BOM compoenet -Hit Re-assing tab on the header and assing all the compoenets only in operation 10 .Make sure that those compoenets should have proper Material amster in MRP3 view Backflash -1-Alawyas active .
    Secondly , in the last operation assing Operation control key -PP03 and make sure that it has Auto GR marked in Define Control Key -Shop Fllor Control Paramaters .
    Check also in Define Production Scheduling Profile -OPJK-Here Auto GR should be active and same scheduling prfole shoudl be used in Material Master Work Scheduling View of FG.
    Now Goto CO11N or CO12-Collective Confriamtion -Enter Order Number -Checks the Goods Movement tab -Here u will fine 261 for operation 10 and 101 for Operation 20 .Check also the Storage location  and posting date with FI and MM periods
    Try and come back
    Regards
    JH

  • ITunes and Wake for network access

    I recently purchased a Logitech Squeezebox music server for the game room. It plays music from my iTunes library remotely (among other things). I set up everything and all is working fine. However, if my iMac goes to sleep, it wouldn't connect. So, I checked the Wake for network access in the energy saver control panel. This also works fine. However, if I have iTunes running on my iMac and wake for network access checked, then the iMac will NEVER sleep. It won't sleep on time out, it won't sleep when selecting from the Apple menu or from the power button. I did some farily extensive testing and if iTunes is running and wake for network access is NOT checked, all is fine.
    I don't do any library sharing and have genius turned off. It appears that when iTunes is running, there is something on the network trying to connect to it.
    Any ideas?
    I am running iTunes 10.2.2 (haven't changed in a while) and OS 10.6.7.

    Anybody have any ideas?

Maybe you are looking for