Show Alert in PreSaveAction after validation of Fields

Hi All,
i have a simple task, but I dont know the function call for this.
I want to show an alert in the PreSaveAction function after verifying that all Values in the Fields are valid.
So something like:
 function PreSaveAction() {           
    if (FieldsAreValid) {           
alert('<%=SPUtility.GetLocalizedString("$Resources:IdeaFactory,PopupTextEditIdeaDialog", null, SPContext.Current.Web.Language) %>');           
return true;   
So my question is: Is there some fuction - FieldsAreValid -  like the PreSaveAction, that i can call in this manner?
Thank for any help
Martin

Hi,
According to your post, my understanding is that you wanted to display validation for fields.
We can customize the new or edit form with InfoPath to achieve it.
In the form, we can add a validation rule to validate the filed with a condition, such as below.
More reference:
http://www.bizsupportonline.net/infopath2007/infopath-basics-3-ways-validate-data-infopath.htm
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support

Similar Messages

  • Application crash on showing alert message after closing document in CS5

    My application crashes when I show alert message after  standard close using IDocFileHandler's close method i.e
    Close( doc, uiFlags, allowCancel, cmdMode );
    Before calling this method there is no crash on showing alert messages.
    i.e just one line before Close() method is called I am able to show alert message. And just one line after close method call , after showing alert message when I  click on OK button of alert message  my application crashes.
    I tried to use errorcode but returned value was fine i.e no error.(Checked GlobalErrorCode and GlobalErrorString before and after close).
    I also tried CanClose method to check but it worked fine.
    I also used IDocumentCommand methods but application crashed without showing  alert message.

    I used PMSetGlobalErrorCode(kCancel) after closing document and it worked.

  • Retain all form field values after input text field validation failure

    Hi,
    I have a form with 1 input text field, one Command button and one h:selectManyListbox. when User enteres some values in input field and clicks on command button named Add, the value is validated. If input is invalid, then an error message appears next to the field. If input is valid, then the value is added into h:selectManyListbox. Adding to list box is done using Ajax4Jsf.
    Probelm:
    Let's assume user entered 3 valid values one after another and all are added into the list box. When he enters a wrong value, and error message appears. however, the entered values in list box goes away. Is there a way to retain the values even after validation failure.
    Code is given below;
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
    <h:panelGroup>
         <h:outputLabel for="inputEmailId1" value="Email Id: " />
         <t:inputText value="#{bean.newEmailId}" id="inputEmailId1" maxlength="100" size="40" immediate="true">
              <t:validateEmail message="Enter a valid Email Id." />
         </t:inputText>
         <t:message for="inputEmailId1" styleClass="errorStyleClass" />
    </h:panelGroup>
    <t:panelGroup style="text-align: left;" >
         <a4j:commandButton value="Add" styleClass="buttonsSub" action="#{bean.addSharedEmails}"
              reRender="inputEmailId1, selectedSharedEmails" />
    </t:panelGroup>
    <t:panelGroup style="text-align: left;">
         <h:selectManyListbox id="selectedSharedEmails" size="8" style="width:100%;" immediate="true">
              <f:selectItems value="#{bean.sharedEmails}" />
         </h:selectManyListbox>
    </t:panelGroup>
    Thanks in advance,

    Use the attribute "binding" instead of a "value". This will remember the value. You can also make sure that you dont have anything in your constructor or class level that initialises that value to "" or null. Because if JSF is remembering your value but your initialization that gets triggered before the page loading resets it to default values then you need to change that part of the code.

  • How  to show password in spry validation password field?

    how do  I make the password display in the spry validation password field , the standard one is just a bunch of asterisk .

    Just use a normal textfield, instead of a password field. The only difference between a password field and a text field is the characters not showing up.

  • JSF keeps displaying old values after Validation Phase fails

    Hi all,
    I would like to ask some help in understanding a particular behaviour that JSF shows when Validation Phase fails.
    I'm using:
    - Tomcat 7.0.2
    - JSF 1.2_12
    - RichFaces 3.3.3
    Problem description.
    I wrote a form with 4 input fields: an inputText and 3 selectOneMenu. The inputText is required while the selectOneMenus don't require any validation.
    Attached to the first selectOneMenu (row 32), is an a4j:support tag so that, whenever the change event is fired, the list of items of the second
    and the third selectOneMenu (row 44 and 58) are correctly filled (note that the mandatory of the inputText is ignored thanks to the ajaxSingle attribute).
    In particular, after loading the two lists of items, the actionListener forces the value of the second and the third selectOneMenu to null.
    This mechanism seems to work fine until I submit the whole form without filling the input text: as expected, JSF validation fails but if I change the value of
    the first selectOneMenu again (causing a new submit), the page keeps displaying the values specified before JSF validation failed for the second and the third
    selectOneMenu (note that the actionListener is still called and the values of the second and the third selectOneMenu are still forced to null).
    Since I'm using a simple PhaseListener, I noticed the following: before JSF validation fails, every time I change the value of the first selectOneMenu, JSF life
    cycle always calls the get method for the second and the third selectOneMenu during the Render Response Phase. In this way, JSF is able to "see" that
    those values have been set to null during the Invoke Application Phase.
    After validation fails, JSF stops calling those getters when I change the value of the first selectOneMenu.
    I hope my explanation was clear enough, thanks a lot for your help.
    Regards,
    Nico
    Web Page
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich">
    <head>
      <title>Prove Rich</title>
    </head>
    <body>
      <h2>Prove Rich</h2>
      <f:view>
      <a4j:outputPanel ajaxRendered="true">
        <h:messages style="color:red" />
      </a4j:outputPanel>
      <h:form>
      <p>
         Input required: <h:inputText value="#{provaProbReplyBean.inputRequired}" required="true" />
      </p>
      <p>
           <h:outputText value="Scegli il canale:" />
           <h:selectOneMenu value="#{provaProbReplyBean.canale}">
            <f:selectItem itemLabel="--" itemValue="" />
            <f:selectItem itemLabel="Profamily" itemValue="Profamily" />
            <f:selectItem itemLabel="Captive" itemValue="Captive" />
            <a4j:support event="onchange" action="#{provaProbReplyBean.caricaProcBanche}"
                                  ajaxSingle="true" reRender="procedure, banche" />
         </h:selectOneMenu>
      </p>
      <p>
           <h:outputText value="Scegli la procedura:" />
           <h:selectOneMenu id="procedure" value="#{provaProbReplyBean.procedura}">
            <f:selectItem itemLabel="--" itemValue="" />
            <f:selectItems value="#{provaProbReplyBean.procedureList}" />
            <!-- immediately save the current value -->
            <a4j:support event="onchange" ajaxSingle="true" />
         </h:selectOneMenu>
      </p>
      <p>
           <h:outputText value="Scegli la banca:" />
           <h:selectOneMenu id="banche" value="#{provaProbReplyBean.banca}">
            <f:selectItem itemLabel="--" itemValue="" />
            <f:selectItems value="#{provaProbReplyBean.bancheList}" />
            <!-- immediately save the current value -->
            <a4j:support event="onchange" ajaxSingle="true" />
         </h:selectOneMenu>
      </p>
      <p><h:commandButton value="Submit" /></p>
      </h:form>
      </f:view>
    </body>
    </html>
    Bean
    public class ProvaProbReply {
         private String inputRequired;
         private String canale;
         private String procedura;
         private String banca;
         private Map<String, List<SelectItem>> canaliProc = new HashMap<String, List<SelectItem>>();
         private Map<String, List<SelectItem>> canaliBanche = new HashMap<String, List<SelectItem>>();
         private List<SelectItem> procedureList = new ArrayList<SelectItem>();
         private List<SelectItem> bancheList = new ArrayList<SelectItem>();
         public ProvaProbReply() {
              List<SelectItem> l = new ArrayList<SelectItem>();
              l.add(new SelectItem("Cessione del quinto"));
              l.add(new SelectItem("Credito al consumo"));
              l.add(new SelectItem("Mutui"));
              canaliProc.put("Profamily", l);
              l = new ArrayList<SelectItem>();
              l.add(new SelectItem("Credito al consumo"));
              canaliProc.put("Captive", l);
              l = new ArrayList<SelectItem>();
              canaliBanche.put("Profamily", l);
              l = new ArrayList<SelectItem>();
              l.add(new SelectItem("BDL"));
              l.add(new SelectItem("BM"));
              l.add(new SelectItem("BPM"));
              l.add(new SelectItem("CRA"));
              canaliBanche.put("Captive", l);
         public String getInputRequired() {
              return inputRequired;
         public void setInputRequired(String ir) {
              inputRequired = ir;
         public String getCanale() {
              return canale;
         public void setCanale(String c) {
              canale = c;
         public String getProcedura() {
              System.out.println("\ngetProcedura called\n");
              return procedura;
         public void setProcedura(String p) {
              procedura = p;
         public String getBanca() {
              System.out.println("\ngetBanca called\n");
              return banca;
         public void setBanca(String b) {
              banca = b;
         public List<SelectItem> getProcedureList() {
              return procedureList;
         public List<SelectItem> getBancheList() {
              return bancheList;
         public String caricaProcBanche() {
              System.out.println("\nListener called\n");
              procedureList.clear();
              bancheList.clear();
              if(canale != null && !canale.equals("")) {
                   procedureList.addAll(canaliProc.get(canale));
                   bancheList.addAll(canaliBanche.get(canale));
              System.out.println("BEFORE setting:\n");
              System.out.println("\nProcedura: "+procedura+"\n");
              System.out.println("Banca: "+banca+"\n");
              procedura = null;
              banca = null;
              System.out.println("\n\n\nAFTER setting:\n");
              System.out.println("\nProcedura: "+procedura+"\n");
              System.out.println("Banca: "+banca+"\n");
              return "";
    }Edited by: 869000 on 28-giu-2011 14.05

    I'm thinking this has to do with the fact that the UIComponents use the localValue after validation fails. This prevents the values from being overwritten when re-rendering the page, i.e. the inputs keep the value set by the user.
    The solution is to manipulate the components directly during the AJAX request when the first pull down is changed. Use the binding attribute to place them into your bean and clear the value directly. That way it will not matter that the expression is not evaluated.

  • Computation after Validation -  possible?

    I there any way to set that computation is triggered after validation.
    I have status field that is set as Draft when users submit form computation changes its value to Submitted.
    The problem is that I have also few fields that should be present before form is submitted.
    What happens is that because status has been changed to submitted, my button disappears also (its condition is to show when status field is Draft only).
    Any suggestions.
    Thanks

    Any process on submit (after computations and validations) is equal to a computation on submit. Only the process point is different. There is no computation after validation.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Is there any ways to make Mail app show prefix and suffix in the address field?

    I apologize for any inconvenience that my poor English may cause.
    I would like to ask if there is a way to make Maill app show prefix and suffix in the address field.
    This is, in my culture, very important, especially for formal situations. When I call someone such as professors, bosses, I should put prefix after their names to show my respect. In Microsoft Outlook, there is a field called 'Display as'.
    http://www.slipstick.com/outlook/contacts/contact-address-book-options-settings/
    Therefore, I can choose how the name will be shown in my messages. For example, Prof. Kim instead of Kim. However, as far as I know, there isn't such options in Mail app. Is there any way that I can modify the way of displaying names in the address field in Mail app?

    As far as I can determine, that is only how you see the email address, not how it is sent.
    You can set up Prefixes and Suffixes in Contacts using the Add Field submenu of the Card menu:
    If you use the Edit Template... command, you can choose to always have the Prefix and Suffix show on new cards.
    However, I don't think Mail uses anything but First, Last for addressing emails.
    You can override the behavior by manually with:
    Prefix First Last Suffix <[email protected]>

  • I bought the company unlocked phone from apple store Canada. It was originally loaded with software 4.2 and was working fine here in SaudiArabia.  Yesterday I updated with IOS 5.0.1.  Now it is showing that sim is not valid.  The same sim works in other p

    I bought the company unlocked phone from apple store Canada. It was originally loaded with software 4.2 and was working fine here in SaudiArabia.  Yesterday I updated with IOS 5.0.1.  Now it is showing that sim is not valid.  The same sim works fine in other phones.

    Here's and update on my problems and here are are some screen shots of the types of problems I've been having since the v5.0.1 update. Keep in mind these are native apps and I have tried the rebuild phone crap many times, nothing helps.
    This is screen shot of a what happened when I tried to use my camera one day, both the front and back cameras were all black. I had to power cycle the phone to get rid of this problem. The cameras appeared to be working correctly, I could focus and zoom but it was all black.
    Here is an image of what happened when I searched for something in a map. This is after I picked the choice I wanted, the keyboard disappeared but the list didn't. I had to force close the app and restart it for this problem to go away. Who knew five bars on ATT was possible.
    And finally this is the messaging app, although you would not know it. I had to return to home screen (after a long pause for it to process the button push) and return to the messaging app. This happens all the time with the messaging app and the notifications sounds drive me crazy. If  i'm using the phone, say browsing the web and I get an incoming message its almost 100% of the time the messaging app will screw up. The sound will play at the wrong time or not at all, message will show up in notifications and diasapear in message app or Ill have a problem like this:

  • Unique problem with validation/ making field required

    I have searched the forums trying to find a way to make a field required based on the users selection of a check box, or something else. So far, everything says use nullTest = "error".
    I have tried to do this and get the following results: The red highlighting, which shows up around my other required fields, will not show up unless you click in the text box and then out of it. Weird! Then, when pressing the submit button, it will not actually give you an error message if there is nothing in that text box, as it will if there is nothing in the fields that I originally make required.
    Any thoughts, or fixes would be greatly appreciated.
    Thanks in advance for any help.

    We do the same thing here. We haven't had any issues with the submit not validating the field correctly though. Our only issue was the red highlighting. To get around this, we would call resetdata on the field. resetData clears out the value of the field so you need to store it off and then reset it.
    if (form1.BP1.ChangeActivities.Pos1.Department==1) then $.validate.nullTest = "error" else $.validate.nullTest = "disabled"
    endif
    $=$
    var x = $
    xfa.host.resetData("form1.BP1.ChangeParticulars.Pos1To.DeptNo")
    $ = x

  • After validation want to state maintain of h:outputText /

    Hi,
    I have some fields with validation,
    after validation want to state maintain of <h:outputText />
    <h:outputText id="form_title" value="#{viewCDBean.form_title}"/>
    <h:outputText id="output1" value="Title"/><h:inputTextarea id="cd_title" value="#{viewCDBean.cd_title}" rows="2" cols="40" required="true"></h:inputTextarea><h:message for="cd_title" style="color:red"/>

    Add a h:inputHidden component which saves the h:outputText value for the next request.

  • Where is Hint Box for Validation Text Field widget?

    I want to enter a hint for my form.
    I am following the instructions on the Adobe Using Dreamweaver CS4 page for Insert and edit the Validation Text Field widget page:
    <http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WSEB5440BC-453A-4101-928C-302199E7E02F. html#WS8E6EA74E-87AC-4a81-A5CC-2DB6FB451DE0a>
    It says:
    Create a hint for a text field
    Because there are so many different kinds of formats for text fields, it is helpful to give your users a hint as to what format they need to enter. For example, a text field set with the Phone Number validation type will only accept phone numbers in the form (000) 000-0000. You can enter these sample numbers as a hint so that the text field displays the correct format when the user loads the page in a browser.
       1. Select a Validation Text Field widget in the Document window.
       2. In the Property inspector (Window > Properties), enter a hint in the Hint text box.
    However, the is no hint box in my Propeties area.
    How do I get this hint box to show up?
    Dreamweaver CS4, Windows Vista

    Hi David,
    My Property inspector looks different than what you have below.
    I do not have a Hint box and I do not have the Customize this widget.
    I did have a Hint box and the Customize this widget for CS3, howver not for CS4
    Alison

  • Redirecting after validating

    hello friends,
    following is the code of the jsp page i am using for validating an user. it is working fine, but i want to redirect or show a html page after the validation. pls suggest me the correct way
    validate.jsp
    <%@ page language="java" %>
    <jsp:useBean id="BA" scope="application" class="BankAccount" />
    <jsp:setProperty name="BA" property="sAccountID" param="sAccountID" />
    <jsp:setProperty name="BA" property="sPin" param="sPin" />
    <html>
    <head><title>Welcome...</title></head>
    <body>
    <%
         String sAccountID=BA.getsAccountID();
         String sPin=BA.getsPin();
         boolean validate=BA.AccountValidate();
         if(validate==true)
              out.println("The user is valid.");
         else
              out.println("The user is not valid");
    %>
    </body>
    </html>
    how should i change the code so that a "welcome" page is shown if the user is valid or show a "invalid user" page if the user is not valid.
    thanks in advance
    harsh

    <%
    if (validate){
    application.getRequestDispatcher("/welcome.jsp").forward(request, response);
    %>
    or just
    <jsp:forward page="/welcome.jsp"/>

  • All my programs show as itunes even after i uninstalled it on windows

    all my programs show as itunes even after i uninstalled it on windows

    I'd start with the following document, with one modification. At step 12 after typing GEARAspiWDM press the Enter/Return key once prior to clicking OK. (Pressing Return adds a carriage return in the field and is important.)
    iTunes for Windows: "Registry settings" warning when opening iTunes

  • TS1538 The device do not show at the itune after update at itune

    How to solve the device do not show at the itune after the update thru itune.
    Now the ipad mini keep show the screen on "USB syr to itune"

    Try and turn off iPad and proceed to step 3 of Recovery Mode.
    Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.
    Note: Data will be lost. You may have to repeat the above many times.

  • User able to execute Tcode after validity of role is over

    Dear all,
    we have given a temporary access to the transaction MR21  to the user for one day but the user was able to use this transaction after validity of role is over.  screen in SU01 shows the role is already expired to her.Is this due to bug or incomplete maintenance nodes in the role

    Hi ,
    Use SUIM make sure that the user does not have that transaction in any other role in his profiles
    second find the role which has the transaction for him .
    Delete that specific role/roles
    Then run  SUPC and PFUD if its a development box or talk to basis  if your project policy is to run this as background job.
    If all the above steps were already done then use ST01(trace) to find what is allowing the user to succeed with the transaction and disable that object.
    Cheers

Maybe you are looking for

  • Play's Fine on Mine But Not on Thier's

    Okay, this is my situation.  I have a presentation that I have imported from PowerPoint with audio that I have on the Captivate 4 timeline.  I have gone into and edited the entry and exit anmimations in the PowerPoint presentation from the Captivate

  • How to remove the note text for column (portal)

    Hi to All, Just i wanted to know how to remove the note (text) which is coming infrond the column in the appraisal template in portal view. My client doest want the text "note" (which i highlighted in the yellow) comming infrond the coulum. Pls can a

  • Playbook BB world won't respond

    Hi. I have been trying to download applications on my playbook but the BB world just won't respond. I keep seeing a blue screen that shows installed. I try swiping down and I see three options; 1.content setting, 2. Payment Option 3. Help. I tried th

  • Spurious lines on edge of print

    For some reason I seem to get a line of dashes along the long edge of photoprints, sometimes it's a series of long dashes sometimes a short dash followed by a long dash followed by a short dash, all the way down the edge.  While it doesn't interfer w

  • Trouble importing from various CDs

    Hi.  I've had several discs full of photos rejected, saying that they are incompatible with iPhoto.  one came from ritz camera, another was a disc of vacation photos that we bought.  i haven't had trouble loading them onto a PC.  Any suggestions?  Th