Submit data using Jquery/Javascript during button click

submit data using Jquery/Javascript during button click

Hi,
From your description, my understanding is that you want to restrict edit form with jQuery/JS.
If you want to restrict the default edit form with jQuery/JS, you could refer to these steps below:
Enter your editform.aspx.
Add below code under <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">.
Save this file.
<script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
function PreSaveAction(){
if($("select[id$='DropDownChoice']").val()==""){
alert("please choose a value!");
return false;
return true;
</script>
The screenshot below is my result(it will not save data after clicking OK in the message alert):
If you customize your list with InfoPath, you could check the checkbox “Cannot be blank” under Validation section or add a rule for your validation as the screenshot below:
In addition, you could check your code with pressing F12 to debug your code.
Best Regards,
Vincent Han
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]

Similar Messages

  • Custom Measure - Unable to Submit Data Using Input Schedule

    We have an application that requires storage of data on a job-to-date basis.  To accommodate this, the application was changed to a YTD application and 3 custom measures were added:
    JTD (base data)
    YTD_JOBS (offsets current period against last month of prior period)
    PERIODIC_JOBS (offsets current period against prior period)
    Everything is working and the measures resolve to the correct values.  The system also completes logic (advanced and dimension) properly.  Data may also be submitted through an Import process. 
    However, we are unable to submit data using an input schedule.  We consistently get a "no data to refresh" error message.  When the same schedule is used in the older, periodic version of the application, the submission works as expected.
    I suspect the problem is the naming of the custom measures is the root cause.  I have been unable to find documentation (BPC 5.1M) related to custom measures for 5.1.  Any help resolving this issue and/or tracking down custom measures documentation for v5.1 is much appreciated.
    Cheers,
    Jeff

    Joost,
    I believe what you are describing is the root of the issue.  The application is set to YTD as the data input type both in the web admin section and in the database table.  The problem is that JTD is the input member for this application -- we are loading job-to-date values instead of year-to-date.
    It seems that BPC does not understand JTD as a "base level" measure fort the input method.  I have not been able to find a table in the database that defines PERIODIC and YTD.  My hope was to add JTD to the settings. 
    Unless someone else has made something like this work, I suspect that I'll have to use YTD as the ID of the base member and restructure the custom measures.  We did not start this way since the user community thinks in terms of JTD data.

  • Check user permission level using jquery/javascript

    On a sharepoint page I need to check permission level for a user and based on permission level he is having i need to hide few elements on that page.any pointers on how to check user permission level using jquery/javascript.
    for eg: i need to do something like this
    if(userpermissionlevel=="custom read"){//hide some elements}
    Any pointers will be helpful.

    Try below
    function checkifUserHasEditPermissions()
    context = new SP.ClientContext.get_current();
    web = context.get_web();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.load(web,'EffectiveBasePermissions');
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
    function onSuccessMethod(sender, args)
    if (web.get_effectiveBasePermissions().has(SP.PermissionKind.editListItems))
    //User Has Edit Permissions
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/f21ad6b1-445a-497d-a286-d3ba8c2928a6/how-to-get-the-current-user-permission-level-on-a-list-item-with-ecmascript
    or
    http://stackoverflow.com/questions/22122139/check-if-current-users-belongs-to-sp-group-using-javascript-client-side-object-m
    http://blog.fidelityfactory.com/2011/11/29/sharepoint-client-ecma-script-check-user-permissions/

  • How can I get a List ID information using JScript on ribbon button click - SharePoint2010

    Dear All,
    I want to display the custom list ID column information on ribbon button click using a JScript.
    For This I have added a JScript in Layout folder in VS 2010 empty project solution and I have put
    the following Jscript code. While running and clicking the ribbon button, it seems like JScript is not
    invoking and not producing any result. It is like control is not going to Jscript file. How can I find out
    the issue???? can anyone please help me on anything wrong with my script or is
    it some-other problem which causes the blank result???
    It is a farm sharepoint2010 solution, debugging is not working in Visual Studio & IE!!!!
    Somebody please help, hard to find the error.....
    Please note the JScript Code: RibAlert.js
    <script>
    '//var siteUrl = '/sites/MySiteCollection';
    var siteUrl = 'http://a5-12457/AllItems.aspx';
    function retrieveListItems()
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Custom List');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
    '<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></View>');
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(collListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args)
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();
    while (listItemEnumerator.moveNext())
    var oListItem = listItemEnumerator.get_current();
    listItemInfo += '\nID: ' + oListItem.get_id() +
    '\nTitle: ' + oListItem.get_item('Title') +
    '\nBody: ' + oListItem.get_item('Body');
    alert(listItemInfo.toString());
    function onQueryFailed(sender, args)
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Please note the Elements.xml
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
    Id="CustomRibbonButton"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Manage.Controls._children">
    <Button
    Id="Ribbon.ListItem.Manage.Controls.TestButton"
    Command="ShowAlert"
    Image16by16="http://a5-12457/IconLib/ICONBTN.jpg"
    Image32by32="http://a5-12457/IconLib/ICONBTN.jpg"
    LabelText="Comapre alert"
    TemplateAlias="o2"
    Sequence="501" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <!-- <CommandUIHandler Command="AboutButtonCommand" CommandAction="javascript:alert();" EnabledScript="javascript:enable();"/> -->
    <CommandUIHandler Command="ShowAlert" CommandAction="javascript:alert();" EnabledScript="return true;"/>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <!-- <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/DocumentTabTwo/RibButton.js" /> -->
    <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/RibAlert.js" />
    </Elements>

    Dear All,
    I want to display the custom list ID column information on ribbon button click using a JScript.
    For This I have added a JScript in Layout folder in VS 2010 empty project solution and I have put
    the following Jscript code. While running and clicking the ribbon button, it seems like JScript is not
    invoking and not producing any result. It is like control is not going to Jscript file. How can I find out
    the issue???? can anyone please help me on anything wrong with my script or is
    it some-other problem which causes the blank result???
    It is a farm sharepoint2010 solution, debugging is not working in Visual Studio & IE!!!!
    Somebody please help, hard to find the error.....
    Please note the JScript Code: RibAlert.js
    <script>
    '//var siteUrl = '/sites/MySiteCollection';
    var siteUrl = 'http://a5-12457/AllItems.aspx';
    function retrieveListItems()
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Custom List');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
    '<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></View>');
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(collListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args)
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();
    while (listItemEnumerator.moveNext())
    var oListItem = listItemEnumerator.get_current();
    listItemInfo += '\nID: ' + oListItem.get_id() +
    '\nTitle: ' + oListItem.get_item('Title') +
    '\nBody: ' + oListItem.get_item('Body');
    alert(listItemInfo.toString());
    function onQueryFailed(sender, args)
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Please note the Elements.xml
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
    Id="CustomRibbonButton"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Manage.Controls._children">
    <Button
    Id="Ribbon.ListItem.Manage.Controls.TestButton"
    Command="ShowAlert"
    Image16by16="http://a5-12457/IconLib/ICONBTN.jpg"
    Image32by32="http://a5-12457/IconLib/ICONBTN.jpg"
    LabelText="Comapre alert"
    TemplateAlias="o2"
    Sequence="501" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <!-- <CommandUIHandler Command="AboutButtonCommand" CommandAction="javascript:alert();" EnabledScript="javascript:enable();"/> -->
    <CommandUIHandler Command="ShowAlert" CommandAction="javascript:alert();" EnabledScript="return true;"/>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <!-- <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/DocumentTabTwo/RibButton.js" /> -->
    <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/RibAlert.js" />
    </Elements>

  • How to create the animation div dyanimcally using jquery+javascript

    Hello,
    after a week of researching and without getting the full result i decided to upload new discussion here and maybe some of you guys will help me.thanks in advance.
    include the file:
    <!--Adobe Edge Runtime-->
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <script type="text/javascript" charset="utf-8" src="animate_edgePreload.js"></script>
    <!--Adobe Edge Runtime End-->
    html code:
    <div id="Stage" class="EDGE-70798230"></div>    if i put it like this of course everthing works fine..i can put more with different id's and they will work fine...
    my problem:
    i dont know how many of this animation i will need...depends of what my server will give me in the response...so i need to create them dynamically...
    i tried lots of things:
    $("#newAnimation").append('<div id="Stage2" class="EDGE-70798230"></div>');    of course with this nothing happend...it even dont get the symbols under stage..and not any of the css...
    $(".EDGE-70798230#Stage").clone().appendTo("#newAnimation");
    $("#newAnimation").children('#Stage').prop('id','Stage2');   then mroe css changes and just then i can see the animation but it doesnt work..."play is not defind" when i try to run the animations..
    i know there is some function that called createChildSymbol/createSymbolChild but none of them work for me...
    i use jquery mobile..so to start the animation for example i do $.Edge.symbol.get($("#Stage")).play();
    i tried to use the loadResources etc....doesnt work too..
    anyone have some idea what i can do? it is possible?

    joel pau thank you for all the support.
    now i will explain the anwer if anyone else will be stuck with the same problem.
    first of all in edge animate need to mark all the things that created and "convert to symbol"(mark all and right click).
    second:
    in the top of your html file you got the script to the edge_preLoad.js .....
    so now in your js code:
    lets say we use append to add new div to our code and now we got <div id="new"</div>.
    $.Edge.getComposition("yourCompositionID").createSymbolChild("yourSymbolThatCreatedInStepO ne","#new");
    like this you can get new animation of the same composition.
    if you want to conroll the animation you just need to take the id of the new symbol your created using jquery or any way you like.
    and example of control it:
    $.Edge.symbol.get("#theNewID").play();

  • How to get iterator used on jsff from button clicked on jspx

    Hi All,
    I am using jdeveloper 11.1.1.5.
    I have a bounded task flow and inside that I have a jsff and I have added one iterator in its bindings. Now I have dragged that jsff on my jspx page as a region.
    I have a button on my jspx page I want to find the iterator of the jsff on button click.
    How to find it.
    Please help.
    -- NavinK

    Thanks Timo for your reply.
    Does that mean We have to add the same iterator in the bindings of jspx as well ?
    In my case I have added the iterator to my jspx page but I am getting the error described in InputText value is not getting updated in Iterator
    Please help.
    --NavinK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Javascript after button click not working

    The problem is on button submit I wanted a javascript prompt which does not work in the portal.
    The code is like this
    privatevoidbtnSubmit_Click(objectsender, System.EventArgs e)
    Page.RegisterClientScriptBlock("alert","<script language='javascript'>alert('Thank you! Your form was successfully submitted.');</script>");
    Could you explain this.
    Thanks

    Hi guys,
    try the following code.
    page_load code
    ===============
    YourButtonName.Attributes.Add("onClick", "JsFnName()");
    Javascript code in .aspx
    ========================
    <script language="javascript">
    function JsFnName()
    alert('Thanks you your form was succesfully submitteid');
    </script>

  • Using jQuery JavaScript library in Visual Studio

    Good time.
    Created a new project for Windows Market JavaScript in Visual Studio. Connected official library jQuery, but do not understand how to work with Visual Studio jQuery? Teams starting with $ () output error. Exactly how to work with jQuery in Visual Studio?
    Example:
    $('#story').data('id');

    Hi,
    What type of project did you create in VS? ASP.NET web app? Windows Store app? Which version of VS do you use?
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Retriving Data from TableView with a Button Click

    Hi,
    I have a TableView and a Button. The requirement is  that the user can select several rows in the tableview and click the button to process the selected rows. I am using the following logic in OnInputProcessing to retrive the rows selected,
    DATA: TB1 TYPE REF TO CL_HTMLB_TABLEVIEW,
           tlist1 TYPE REF TO OBJECT.  
    case event->name.
          WHEN 'button'.
                   CALL METHOD cl_htmlb_manager=>get_data
                      EXPORTING
                         request = runtime->server->request
                         name = 'tableView'
                         id = 'tvX'
                      RECEIVING
                          data = tlist1.
             TB1 = tlist1.
    Then access TB1->data->prevselectedrowindextable to find out which row indexes the user has clicked in TableView.
    However I get error that can't assign type ot tlist1 to TB1.
    The return type of tlist1 is TYPE REF TO CL_HTMLB_TABLEVIEW so this assignment should be possible.
    But I think the problem is only during runtime is the type of tlist1 knowm. ?
    Also, is there a better way to retrive multiple rows from a tableview when a button is clicked ?
    Thanks

    Anand,
    <i>But I think the problem is only during runtime is the type of tlist1 knowm. ?</i>
    You are correct that ? is the character you are looking for here. In your next quiet moment, spend some time reading ABAP online docs (or in fact any OO like language) on casting.
    DATA: tb  TYPE REF TO CL_HTMLB_TABLEVIEW,
          obj TYPE REF TO OBJECT.
    obj = tb.
    tb ?= obj.
    You need the ? to indicate to ABAP that are casting from an OBJECT to something bigger. Notice that in the other way this is not required.
    (If you find the relevant link onto help.sap.com, you can append it here. I don't have it handy at the moment.)
    brian
    PS: I see that you are new in our small corner of SDN, and would thus recommend that you also look at <a href="/people/brian.mckellar/blog/2004/06/11/bsp-trouble-shooting-getting-help">Getting Help</a>. It helps to keep the learning curve short.

  • How to generate xml file from an array of data using jQuery

    Hi All,
    Iam facing the problem with diaplaying array of data into a xml file, Actually iam using SAPUI5 commons table to display the backend data, each row in the table has checkbox. If we select each checkbox, iam getting the particular record and push it into an empty array and then i should show that array of data into xml file.

    OData.request 
    requestUri: url,  
    method: "POST",
    headers: {                    
    "X-Requested-With": "XMLHttpRequest",                  
    "Content-Type": "application/atom+xml",
    "DataServiceVersion": "2.0", 
    "Accept": "application/atom+xml,application/atomsvc+xml,application/xml",  
    "X-CSRF-Token": header_xcsrf_token   
    data: requestTableDATAArray
    // Response after posting and set message
    function (data, response) 
    alert(response.body);//gives xml format

  • Send the array in querystring using jquery/javascript

    hi friends.
    var obj = [];
        obj[0] = {Guest:"Ramkumar", City: "Madurai", Mobile: "9578606320", Email: "[email protected]", Address:"first street" };
        obj[1] = {Guest:"Sathish", City: "Madurai", Mobile: "9578606320", Email: "[email protected]", Address:"first street" };
        obj[2] = {Guest:"Suresh", City: "Madurai", Mobile: "9578606320", Email: "[email protected]", Address:"first street" };
        obj[3] = {Guest:"Ganesh", City: "Madurai", Mobile: "9578606320", Email: "[email protected]", Address:"first street" };
        var x = JSON.stringify(obj);
        window.location = "view.html?Object=" + JSON.stingify(obj);
    I got the error :  "Internal Server Error."  
    pls tell how to send the array using querystring.. .

    This is not possible in the Small Basic programming language. It is better to look for another forum, e.g. for javascript.
    Jan [ WhTurner ] The Netherlands

  • How to generate barcode on button click event in PDF using adobe livecycle?

    I already created form in PDF file which is validate completely .But , I required generate a barcode of all field of form using custom script on button click event.
    Please give me right way for doing it .
    Thanks in Advance,
    Jaydeep Solanki.

    Hi vijay,
    What project are you doing? Is it Asp.Net project? If so, you'll need to post it in the dedicated ASP.Net Forum
    http://forums.asp.net  for more efficient responses, where you can contact ASP.NET experts.
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • To Dispaly stale data page when browser back button is clicked.

    Hi All,
    How can we display Stale Data Page when the browsers back button is clicked.
    thanks

    You have already raised a thread for this..
    To display Stale Data Page when browsers back button clicked.
    - Senthil

  • Smartview adhoc to submit data

    we are trying to submit data using smartview adhoc "submit data" button.  However, instead of hard coded values in the data cell, we are using a formula to calculate the value to be submitted.
    for example, in cell F24, instead of typing in 200, it uses a formula cell A10*2 to get to calculate a value to submit.  When I click on Submit data with that formula there, it will not submit the data.  I know the intersection points are valid because if I sumbit a hard coded value it is submitted successfully.
    I do have the "Preserve Formula and Comments on Adhoc Operation (Except pivot) checked.  If I uncheck this and click submit.  it brings back the data from the cube and my formulas are gone.  So I cannot remove the check for the "Preserve formula"
    is there any way to submit data based on calculated value?
    we will be submitting data to both Essbase and HFM cube.
    The SV version we are using is 11.1.2.1.103 (Build 100)
    Thanks!

    The issue is fixed in SV 11.1.2.2. Please refer - Smart View Submit Data Fails If "Preserve Formulas" Option Checked. (Doc ID 1475272.1)
    HTH -
    Jasmine.

  • Validate Date and block JavaScript page change

    how I can validate date acrobat, can block JavaScript page change, only change with a button? 

    If you use the "util.scand" method date validation is part of the process. It either returns the number of milliseconds from the Epoch date used by JavaScript for the date time object the null value.
    Date Arithmetic has some sample scripts, but you need to keep in mind that Date and Time are not independent and using "new Date()" returns the date and time at the time that line of code is executed and that can cause issues for the computing of dates only.
    Are you sure of day count, most differences include the start and end dates in the number of days for the calculation.
    Custom calculation for today's date field (format is None):
    // get today's date an time
    var oToday = new Date();
    // set to start of day
    oToday.setFullYear(oToday.getFullYear(), oToday.getMonth(), oToday.getDate(), 0, 0, 0, 0)
    // set field value
    event.value = util.printd("d/mm/yyyy", oToday);
    Custom calculation for the difference in days field (format None):
    var cEnteredDate = this.getField("EnteredDate").value;
    var cToday = this.getField("Today").value;
    event.value = "";
    if(cEnteredDate != "" && cToday != "") {
    // process only if date values not empty
    // convert date strings to date time objectat midnight
    var oEnteredDate = util.scand("d/mm/yyyy", cEnteredDate );
    if (oEnteredDate == null) {
    app.alert("Error in processing entered date", 2, 0);
    oEnteredDate.setFullYear(oEnteredDate.getFullYear(), oEnteredDate.getMonth(),oEnteredDate.getDate(), 0, 0, 0, 0) 
    var oToday = util.scand("d/mm/yyyy", cToday);
    if(oToday ==  null) {
    app.alert("Error converting today", 2,0);
    oToday.setFullYear(oToday.getFullYear(), oToday.getMonth(),oToday.getDate(), 0, 0, 0, 0) 
    // convert date objects to days
    var nEnteredDate = Math.floor(oEnteredDate.getTime() / (1000 * 60 * 60 * 24));
    var nToday = Math.floor(oToday.getTime() / (1000 * 60 * 60 * 24));
    // compute & format the difference
    event.value = util.printf("%,0 1.0f", (nToday - nEnteredDate));

Maybe you are looking for

  • File size increase with Camera Raw

    I have a bunch of scanned .tif files. If I open them in Photoshop (cs5) then resave them the file size stays the same. If I open them in Camera Raw then "Open Image" to enter Photoshop, the file size doubles (both the size reported by Photoshop and t

  • Want to crate a dynamic formula depending characteristics

    Hi experts, I want to create a query which calculates the following: I have some products, some factories and the variable month.I want to find what percentage of product A  is produced in factory A month by month.(also for product B in factory A, pr

  • LMS4.0.1 Nexus 5020 - internal error in inventory collection

    Hello, 2 Nexus 5020 (SysObjId ...3.719) brings internal error in inventory collection as following: "RICS0001: Internal Error, unable to process the collected data from the device" whereby 2 other devices from same type, same sysobjid are working wel

  • Discoverer Plus : Printing title issue

    Hi, Page title doesn't print all the time. Sometimes it's printed and sometimes it's not without changing anything in the report! Do you know why? OracleBI Discoverer 10g (10.1.2.2) Oracle Business Intelligence Discoverer Plus 10g (10.1.2.54.25) Disc

  • Restrict Subject Areas

    Hi, I am trying to restrict access to certain subject areas in answers. I would like specific groups/users to have access to certain subject areas. Is this performed in rpd or in answers? Thanks