How to give dropdownlist validation using javascript

I have a sharepoint list, In that list i have a dropdown field,in that field i have values <--select-->,ram, raj like this, when user selected the <--select--> value and then click on savs button, it has to show the validation message like user
need to select the value like that,using javascript or jquery i need to validate that.

Hi ,
add the following code in by  editing page.
<script src="http://code.jquery.com/jquery-1.11.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("input[value='Save']").click(function(){
var value = $("select[title='dropdown column name'] option:selected").text();
if(value!="1"){
alert(value);
return false;
https://social.technet.microsoft.com/Forums/security/en-US/4cd9429a-2261-4446-87d4-188ad10ae6c1/how-to-put-validation-in-sharepoint-list-item-for-dropdown-value-that-user-cannot-jump-from-first-to?forum=sharepointdevelopment
http://sharepoint-2010-world.blogspot.in/2013/11/validate-dropdownlist-using-jquery.html
Regards,
Rajendra Singh
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
http://sharepointundefind.wordpress.com/

Similar Messages

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • Pre-validation using JavaScript cannot work in JSF?

    Sometimes we need to do pre-validation using JavaScript in some senarios that data need be entered and validated at client site before it reaches to Web Application Server. Remind that JSF is a server validation. Creator seems not to allow Developers to do pre-validation using JavaScript for any editable input fields in form. I will illustrate an example and hope anyone can help me to solve it out.
    Assume that if we write the a new web page that allows User enters Name and Phone. The pre-validation function called test() is written in JavaScript for validating field Phone. For simplicity, the below HTML/JavaScript without nested in table is a simple one for HTML form.
    <html>
    <body>
    <script language="JavaScript">
    function test(){
         if (form1.phone.value == "")
              alert("Please enter phone number in digits.");
              return false;
    </script>
    <form name=form1>
    <input id="phone" type="text" size=20><Br>
    <input id="name" type="text" size=20><Br>
    <input type="submit" id="submit" onclick="test()" value="Submit">
    </form>
    </body>
    </html>
    Now, we consider using Java Studio Creator to generate the same form as describing above. The script is shown below:
    <?xml version="1.0"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <html>
    <head>
    <title>testForm Title</title>
    </head>
    <body rave-layout="grid">
    <h:form binding="#{testForm.form1}" id="form1">
    <h:inputText binding="#{testForm.textField1}" id="phone" style="position: absolute; left: 192px; top: 96px; width: 168px; height: 23px"/>
    <h:inputText binding="#{testForm.textField2}" id="name" style="position: absolute; left: 192px; top: 144px; width: 168px; height: 23px"/>
    <h:commandButton binding="#{testForm.button1}" id="submit" style="position: absolute; left: 192px; top: 216px" value="Submit"/>
    </h:form>
    </body>
    </html>
    </f:view>
    </jsp:root>
    After running Script that Creator created, the HTML is generated and reduced (for simplicity) as follows:
    <f:view>
    <html>
    <body rave-layout="grid">
    <form action="/rave/rave" id="form1" method="post">
    <input id="form1:Phone" type="text"></input>
    <input id="form1:name" type="text"></input>
    <input id="form1:button1" value="Submit" onClick="test()"></input>
    </body>
    </html>
    </f:view>
    Take a look carefully at <input> elements. We see the syntax for naming for each "input" element that there is a semi colon added between form1 and phone or form1 and name. This syntax is generated from built-in JSF components. Hence, I rewrite the test() JavaScript function to match with the naming that Creator generated as follows:
    <script language="JavaScript">
    function test(){
         if (form1.form1:Phone.value == "")
              alert("Please enter phone number in digits.");
              return false;
    </script>
    Clearly, this JavaScript cannot be worked because of a semi column that Creator has named it.
    I have tried to work arround for this but cannot find a solution except changing the name such as: from <input id="form1:phone" ...> to <input id="form1_phone" ..>. But I could not change or modify the scripts because it is generated from JSF components when running it under browser.
    I guess to solve this problem, the naming for elements in form should be reconsidered in the next release of Java Studio Creator.

    Hi Marie,
    I currently sucess in client pre-validation using JSF. I found a way to do it.
    Please take a look of how javascript has been added in the following scripts:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <html lang="en-US" xml:lang="en-US">
    <head>
    <meta content="no-cache" http-equiv="Cache-Control"/>
    <meta content="no-cache" http-equiv="Pragma"/>
    <title>login Title</title>
    </head>
    <body style="-rave-layout: grid">
    <h:form binding="#{login.form1}" id="form1">
    <h:outputLabel binding="#{login.componentLabel1}" for="componentLabel1" id="componentLabel1" style="position: absolute; left: 216px; top: 72px">
    <h:outputText binding="#{login.componentLabel1Text}" id="componentLabel1Text" value="Application System Name"/>
    </h:outputLabel>
    <h:panelGrid binding="#{login.gridPanel1}" columns="3" id="gridPanel1" style="position: absolute; left: 72px; top: 168px; width: 504px; height: 100px">
    <h:outputLabel binding="#{login.componentLabel2}" for="componentLabel2" id="componentLabel2">
    <h:outputText binding="#{login.componentLabel2Text}" id="componentLabel2Text" value="User Name: "/>
    </h:outputLabel>
    <h:inputText binding="#{login.textField1}" id="textField1" onclick="" style="width: 149px; height: 22px"/>
    <h:outputText binding="#{login.outputText1}" id="outputText1"/>
    <h:outputLabel binding="#{login.componentLabel3}" for="componentLabel3" id="componentLabel3">
    <h:outputText binding="#{login.componentLabel3Text}" id="componentLabel3Text" value="Password: "/>
    </h:outputLabel>
    <h:inputSecret binding="#{login.textField2}" id="textField2" style="width: 147px; height: 22px"/>
    <h:outputText binding="#{login.outputText2}" id="outputText2"/>
    <h:outputLabel binding="#{login.componentLabel4}" for="componentLabel4" id="componentLabel4">
    <h:outputText binding="#{login.componentLabel4Text}" id="componentLabel4Text"/>
    </h:outputLabel>
    <h:commandButton action="#{login.ok_action}" binding="#{login.button1}" id="button1" onclick="return checkUserIdentity(this.form)"
    style="width: 90px; height: 25px" value="OK"/>
    <h:outputLabel binding="#{login.componentLabel5}" for="componentLabel5" id="componentLabel5">
    <h:outputText binding="#{login.componentLabel5Text}" id="componentLabel5Text"/>
    </h:outputLabel>
    </h:panelGrid>
    </h:form>
    </body>
    <script type="text/javascript">
    function checkUserIdentity(form){
    var userName = form["form1:textField1"].value;
    var userPassword = form["form1:textField2"].value;
    if (userName == "") {
    alert("Please enter User Name.");
    form["form1:textField1"].focus();
    return false;
    if (userPassword == "" ){
    alert("Please enter password.");
    form["form1:textField2"].focus();
    return false;
    form.submit();
    return true;
    </script>
    </html>
    </f:view>
    </jsp:root>
    The key for getting data value from Form based on Javascripts is var userName = form["form1:textField1"].value;
    Thanks,
    VTT_

  • How do I do validation using SDK.

    How do I do validation using SDK.
    We have created different warehouses for the client business operations.
    For eg:
    1. Inspection Stores
    2. Rejection Stores
    3. Main Stores
    In Goods Return & A/P Credit Memo, other than RejectionStores is
    selected, we want to generate a warning message.
    How do I do this through SDK.
    I need the code sample for the following activity:
    1. Reading the data available at each row of the current form (Goods
    Return/ A/P Credit memo)
    2. Validate the data with a paricular warehouse
    3. Generate warning message.
    I could not find any samples related to this.

    There is a method called MessageBox for the Application object. Have a look at
    the documentation, everything is there.

  • How find the missing glyph using javascript [like indesign preflight], and replace same glyph available font or

    The situation:
    I want to use basetext font, but some of the glyphs are missing in it, and are highlighted with pink boxes. common font [stix, etc.] have much more glyphs than basetext font. I can apply common font [stix, etc.]manually for each of the missing glyphs or insert two character and use kerning set it up, but it is tedious.
    Question:
    How find the missing glyph using javascript [like indesign preflight], and replace same glyph available font or insert two character and use kerning set it up?
    Any one know how to do this?
    Thanks in Advance,
    ~Jack

    Try Peter kehrl's script
    http://www.kahrel.plus.com/indesign/missing_glyphs.jsx

  • Hi gurur's how we  give the validations to the table

    hi gurur's how we  give the validations to the table. plz help me

    Hi Sri...
    Please clarify your requirement.
    If you want to put some validation in a Z table,you can put your code in Table Maintenance Genereators Events.
    Go to SE11 --> Utilities --> Table Maintenance Generator --> Environment -->Modification --> Event
    Choose the Event and Put your code in corresponding routine.
    Hope this help.
    Reagrds,
    Piyush Mathur
    Rewards Points, if helps

  • How reset Acrobat form field using javascript API

    How reset Acrobat form field using javascript API

    There are several ways:
    resetForm(["Text1"]);
    or
    getField("Text1").value = getField("Text1").defaultValue;
    George

  • How to get SharePoint Groups using Javascript in SP2013 ?

    How to get SharePoint Groups using Javascript in SP2013 , not JSOM please

    Here is the code that worked for me:
    <script type="text/javascript">
    var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups";
      var requestHeaders = { "accept" : "application/json;odata=verbose" };
      $.ajax({
        url : requestUri,
        contentType : "application/json;odata=verbose",
        headers : requestHeaders,
        success : onSuccess,
        error : onError
      function onSuccess(data, request){
    var s='';
     for (var i = 0; i < data.d.results.length; i++)
    s +=data.d.results[i].LoginName+'\n';
        alert(s);
     function onError(error) {
        alert("error");
    </script>

  • HTMLB Form Validation using JavaScript

    Hi All,
    <b>
    I have created a portal appliaction using JspDynPage.
    I have created a form using HTMLB tags. I want to validate the inputfields before sending it to the server for processing.
    The validation has to be done using Javascript
    </b>
    <b> How do i got about this ??? </b>
    regards
    Brahmachaitanya

    I have written the following code to perform the validation.......
    <b>
    function validate()
              var funcName=htmlb_formid+"_getHtmlbElementId";
                func=window[funcName];
              var inpBox1 = eval(func('if1'));
              var eno=inpBox1.getValue();
              if(eno=='' || eno==null)
                   alert('Please Enter Employee Number');
                   htmlbevent.cancelSubmit=true;
              var inpBox2 = eval(func('if2'));
              var ename=inpBox2.getValue();
              alert(ename);
              if(ename=='' || ename==null)
                   alert('Please Enter Employee Name');
                   htmlbevent.cancelSubmit=true;
              var inpBox3 = eval(func('absencetype'));
              var atype=inpBox3.getValue();
              if(atype=='' || atype==null)
                   alert('Please Enter Absence Type');
                   htmlbevent.cancelSubmit=true;
              var inpBox4 = eval(func('if4'));
              var from=inpBox4.getValue();
              if(from=='' || from==null)
                   alert('Please Enter From Date');
                   htmlbevent.cancelSubmit=true;
              var inpBox5 = eval(func('if5'));
              var to=inpBox5.getValue();
              if(to=='' || to==null)
                   alert('Please Enter To Date');
                   htmlbevent.cancelSubmit=true;
              var inpBox6 = eval(func('if6'));
              var approve=inpBox6.getValue();
              if(approve=='' || approve==null)
                   alert('Please Enter Approver Name');
                   htmlbevent.cancelSubmit=true;
    </b>
    The problem now is that i am getting the <b> alert message only for Employee Number.</b>
    <b> I am not getting the alerts if I leave the the other fields blank </b>
    <b> How do i go about this ????????? </b>
    regards
    Brahmachaitanya

  • How to call a url using javascript

    Hi friends
    Iam a newbie i have a requirement
    i have to call some n number of URL using javascript i have all my url in one table .... i have to call all the url from that table ... and the output of the url should be saved in a flat file...The output of the url is in XML format... can any one please suggest me in doing my task ... and one more thing in which tool can i run the javascript coding...please give me ur suggestion and idea how it can be done ....
    My URL for example ll be like this as shown below wen i run this url it ll give me an XML format output
    HTTP://www.myserver.com/ev_api.action?user_id=<username>l&password=<password>&statevar=history&cutoff=<date>&id=<id>
    Thanks in advance
    Thiliban

    thilib wrote:
    In this OTN is there is javascript forum can please give me the link for it
    Thanks
    thilibJust to rephrase Walter's reply: there is no javascript forum in OTN!

  • How to disable the ribbon using javascript

    when open a PDF document using acrobat X, there is a Tool ribbon in the top right side (there is also a comment ribbon and share ribbon), how to disable or remove the Tool ribbon using javascript?
    I try to use app.listToolbarButtons() and app.hideToolbarButton(...) but not working.
    Any ideas?

    Not possible.

  • How to Hide f:subview using javaScript

    Hi
    In our application i have to hide and show the subview using javascript is it possible i tried like this.. but its not working
    <f:subview id="viewid" >
    // view contents
    </f:subview>
    In java script
    document.getElementById("viewid").style.visibility="hidden";
    Any suggestion to me..
    Regards
    Hari

    The f:subview doesn't render anything to the response. You should know that if you have checked the rendered HTML source.
    Wrap its contents in a h:panelGroup and give it an ID. And don't forget to adapt the clientside Javascript language on the clientside HTML source, not on the serverside JSF source.

  • How hard is it to use javascript to show/hide fields. Is it easier to use the action builder?

    I know nothing about javascript and all that ive been using so far has been stuff ive found on here (thank you everyone).
    Using the action builder seems like its gonna be very tedious to do since i have so many subforms that hide, would it be esier to use javascript?

    I know nothing about javascript myself but I just created a form with about 10 different subform that show or hide depending on what the user chooses from a drop down list and I used Action Builder. If we don't know javascript, how can we use it? But Action Builder did a fine job of hiding/showing wherever I needed it. And Action Builder can do more than one thing by clicking that + sign when you are building an action.
    For instance, I needed to place a button in each subform that would close both the field that the person was working in and also the subform on the next page where the information was going into floating fields in a text block that was only visible thru a drop down list text select. I could have never figured out how to do that based on my knowledge of javascript. Thank Adobe for including Action Builder in this version of LiveCycle and I use it all the time. I find it extremely easy to use but it takes a little mental training to think thru the steps of how you can use the menu in Action Builder to make your form do what you need it to do.
    And if all else fails, ask this forum. I struggle for just so long before I come here and ask for help. I always get the answer I need. I hope you will too.
    Good luck,
    Jeanette

  • How to manipulate pdf files using javascript in action wizard

    Respected all ,
    I am a software programmer from india and i want to make a programe which can do below described things :
    I want to know that how can i achive this kind of steps using javascript in acrobat XI :
    for ex. if i have  4 pdf files :  800123-001.pdf , 800123-002.pdf    and  800555-001.pdf , 800555-002.pdf
    then i want to do using javascript
    step 1 :  pdf to ps , output should be : 800123-001.ps , 800123-002.ps , 800555-001.ps , 800555-002.ps
    step 2 : ps to pdf (acrobat distiller ) : 800123-001.pdf  , 800123-002.pdf , 800555-001.pdf , 800555-002.pdf
    step 3 : pdf merge : 800123.pdf  - > which contains both : 800123-001.pdf and 800123-002.pdf
                   and                     800555.pdf -> which contains both : 800555-001.pdf and 800555-002.pdf
    ----------END------------
    Is it possible using javascript in acrobat or any other way ?

    i can not access adobe site .. can you plz replay me on my personal e
    mail.. [removed personal contact info, please send a forum message instead]
    On Wed, Jun 19, 2013 at 1:16 AM, Test Screen Name
    Message was edited by: sinious

  • How to set readOnly property using javascript

    Hi Folks,
    How do I make an inputtext readOnly using javascript?
    I have tried the following
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.setProperty('readOnly', 'true');
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.readOnly = true;
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.setAttribute('readOnly', 'true');None of the above works. Any idea?
    Thanks
    Vishal

    http://docs.oracle.com/cd/E12839_01/apirefs.1111/e12046/oracle/adf/view/js/component/rich/input/AdfRichInputText.html#getReadOnly__
    Get function for attribute for 'readOnly'. This attribute is secured. You may get it, but you may not set it. Any changes to this attribute will not be transmitted to the server.
    Setting readOnly inputText value using javascript.

Maybe you are looking for

  • Read only fields in selection screen

    Hi, I have a parameter in a selection screen and wanted it be read only, mean only values could be displayed but it should not allow the user to either enter or modify existing values. Can any one please suggest how to do this ? Thanks and best regar

  • How to create mapping diagrams in ODI?

    Is there anything in ODI similar to informatica stencil for visio to create the mapping design diagrams to show the data flow and transformations in a visio schematic diagram? Thanks for your feedback.

  • Proxy to Proxy Communication Error

    Hi, I have performed the following setup according to a tutorial for Proxy to Proxy framework. I have 2 servers 001 (Integration Server) and 002 (Integration Engine). I installed two 3rd party Techincal Systems on 002. I have defined the settings in

  • Cube Question: slot loading mechanism slips so how to clean?

    I carefully took the combo out of the machine, took its cover off, and figured out carefully how the mechanism works for pulling in discs and ejecting them. I found the 5 inch long bar with the long "skinny in the middle" rubber cover. The rubber cov

  • Error when I executed my JSP page

    Hello, I have installed in my machine o OracleAS e o OracleDS. I created a JSP page using Reports Builder. When I try run my page, after some time, the following error message is displayed in the browser: Reports Error Page Wed Jun 19 10:08:29 BRT 20