Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Append query string parameter to "Save" but on OOTB "NewForm.aspx"

$
0
0

When the "Save" button of an OOTB default "NewForm.aspx" is clicked, it takes the user back to the AllItems.aspx page of the list. I would like to append a query string to the "Save" button to filter one of the columns. I've tried to add this jQuery to the NewForm.aspx page:

  $("input[value='Save']").click(function () {
        location.href = "AllItems.aspx?FilterField1=Title&FilterValue1=MyStuff"
    });

However, it would not work. The "Save" button has an inline onclick which is:

<input type="button" name="ctl00$ctl33$g_a978132a_d139_4b01_bf56_c22134d88955$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem" value="Save" onclick="if (!PreSaveItem()) return false;if (SPClientForms.ClientFormManager.SubmitClientForm('WPQ1')) return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ctl33$g_a978132a_d139_4b01_bf56_c22134d88955$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))" id="ctl00_ctl33_g_a978132a_d139_4b01_bf56_c22134d88955_ctl00_toolBarTbl_RightRptControls_ctl00_ctl00_diidIOSaveItem" accesskey="O" class="ms-ButtonHeightWidth" target="_self">
Any ideas of how I can accomplish this? 


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>