.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Form Action Button to pass parameters through URL and how to fill a NewForm with them

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :SharePoint
Hi I'm trying to solve a bigger problem we have in babysteps, and I guess after days of searching and trying I simply need to ask for help. The big picture is, that we're trying to put a Form Action Button (via Sharepoint Designer 2007) above a custom DataForm DispForm.aspx which is supposed to navigate to a NewForm.aspx where the Title Field is supposed to be prefilled with a parameter from the DispForm and the user should be able to add information to the item before it is saved. I found several explanations from people on the internet, but nothing really worked. The first babystep would be to get the parameter through the button into the url of the new item.   < input type = "button" value = "Zugriff Beantragen" name = "btnFormAction0" onclick = "javascript: {ddwrt:GenFireServerEvent('__redirect={../Zugriff Beantragen 2/NewForm2.aspx?test={ItemID}')}" />   That's the code for my button. Somebody wrote that should definitely work because SharePoint is able to replace {ItemID} with the actual ID of the item. Well.... it kind of doesn't. What I get as the end of the new URL is exactly "...?test={ItemID}"   I tried with different names for the ID, I added an @ before those ... no change. I read somewhere about javascript.functionName() which should work with all parameters of the item, but

View Complete Post

More Related Resource Links

How to pass parameters via a button control

Hi all, I would like to pass a number of parameters via a button, (it must be a button) but I don't know how to do this, could someone please help. I've be grateful for any suggestions    

SharePoint Designer: Sending parameters with "Navigate to Page" form action

I want to create a custom button in my SharePoint form that uses Form Actions that commit the changes in the fields and then navigate to a designated page.  This works very well.

Then I want to send a parameter with the URL, for example: http://.../customform.aspx?ID={@ID}.  SharePoint Designer offers this option, but I have not been able to make it work.  Every time it just sends the literal {@ID} instead of it's content.

Has anyone solved this issue?

How to pass parameter in sharepoint form action "Navigate to page"

I'm new to MOSS 2007, currently working on the SharePoint form.
In the NewForm.aspx page, once user entered all the fields and click on the "save" button, the data will be save into the list and also i tried to redirect it to other page.

I read few articles on this issue, most of it is about redirect to same directory but different page. Example: Allform.aspx, Display.aspx or editform.aspx.

I wanted to redirect to different path page.
javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={http://server/test/myForm.aspx}')}". This line works when i click on the "save" button.

Assume i wanted to pass a title parameter to directed page.
javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={http://server/test/myForm.aspx?PageTitle_x003D__x007B_@Title_x007D_}')}  <=== this line not working, what i get from the directed page by using querystring is "{@Title}". 

How can i pass the parameter to directed page and read the value?

Anyone can help me on this?


pass value from textbox to action, formcollection best way here?


Hi I'm building a e-commerce store and on quantity of product I'm going with a textbox. I thought I would ask how would you do this? a viewmodel to use a strongly typed textbox or just get the value of the textbox from the formscollection passed in to the action?

Thanks for any input

How to pass value to another form


Dear experts,

                     I have QuoteNumber filed in Db.aspx(ddquote.txt) i want to pass this QuoteNumber values(values should to another web form/page i.e. mail.aspx when i click mail button, Message should supposed to display in textbox(txtQuote.txt) of mail.aspx form/page is "You are sending "QuoteNumber"  quotation to "MailID", Thanks.




How to pass parameters to MDX through URL?


I have an SSRS report. I created it using BIDS and it uses a Sql Server Analysis Service data source.  The data source query is an MDX query with one parameter: @region, a default value has been set for this parameter.  The value which @region takes looks like [USA].[Northeast].[New Hampshire].[Coos County].

The MDX query goes like this:

Select ....


WHERE StrToMember(@region)

This report runs properly inside BIDS or through web browser after deployment.  In my report manager at http://localhost/Reports, I am able to view this report by selecting the value for the @region parameter from a dropdownlist, which contains such values as

Coos County
Cheshire County
Sullivan County
Strafford County
... ...

I know that we can pass query parameters to SSRS through the URL. I have successfully done so with relational database which uses regular SQL. But, I have not succeeded in passing this @region parameter of my MDX query through the URL.

I tried the following:


It didn'

How to fill out a form as another user , while using profiles database


I have created an InfoPath 2007 form. It works great.. I have 5 data connections to sharepoint lists and profile's database. The form displays public data (profile database) about the user, such as name, manager.. etc.

What I would like to do is have an option on the form that says " If you are not this person , click here" , manually type the persons last name , and bring up their information.

Basically , there are some people who will have someone else fill the form out for them. But I don't want them to be giving out their username and password to the system.

I want the ability to fill out a form as another user without logging off sharepoint. 

Infopath 2007 print view in browser enabled form with Print button


Hi i create a  print view brower enabled form in Infopath 2007 with header and footer. In Infopath works fine. Margin was ok, header and footter to. But then i try to print this browser the margin, header and footer it changes to default setting of browser ? I try also create a print button in form with VS 2008 code, but method :

this.print(); not working.

It is possible to print the "print view" in browser as the same like in Infopath 2007? Does anyone have the code how to create a print button in C# on browser enabled form?

Somehow to pass a value to a action without having it on display in url?


Hi. I really cant figure this out but so I thought I would ask you. My scenario is I'm listing customers with paging. Lets say Im on page 4 and I choose to edit a customer. What I want to do is to be able to return to that page 4 when Im done editing the customer. How should I approach this?

Need to pass parameters from URL to fields in Custom List


I have a complex customized list and I need to pass parameters of two fields so that when the 'Questionnaire' is completed and subsequentially opened after initial submission, it will retrieve the Number and GUID automatically in respective fields. I send an email out with a link to the 'Form' that carries the parameters. I am trying to use the following javaScript but am unsure as to where to place this on the SharePoint page for it to work.



<script type="text/javascript">

function loadFormVars()
getQuerystring('CustodianGUID', 'ctl00_m_g_d08916d8_7224_4665_be72_2de381f45985_ff46_1'); ///replace
customerGUID and form field name
'ctl00_m_g_d08916d8_7224_4665_be72_2de381f45985_FormField11_ctl00_ctl00_TextField'); ///replace customerGUID
and form field name

alert("it works");

function getQuerystring(key, field)
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
document.getElementById(field).value = qs[1];


Button in a form that does not submit


I've been trying to figure this out all afternoon but my google-fu seems to be failing me. I'm setting up a page with a fairly large form, which has one field that is going to require some kind of popup page that will allow the user to perform a lookup. At the moment I'm only prototyping the page so I'm actually only attempting to a the button up to fire an alert when the button is clicked instead of generating a lookup screen. However it seems that no matter what I do the button causes the form to submit.

I remember one of the very first ASP .NET beginner videos I ever watched went through configuring a button to perform actions without submitting, but I can't seem to figure out which one it was.

Infopath form using Visual Studio - How to bind repeating table on submit button click ?


Hello friends,

   I have created infopath form using Visual Studio 2008

Form have 3 dropdowns and one repeating table which is bound by Datasource ( List from sharepoint ).

whenever i select appropritae values from drop down, Repeating table gets bound as datasource for dropdown and repeating table are same.

I have done conditional formating for repeating table using repeating table properties.


My Question:


Now i included one submit button and i want when i click submit button it will check DropDown Values and if appropriate record matching these values found it will fill repeating table

How i achive this ? as i dont find how to bind repeating table on submit button.

Please help if anyone have answer.


Thanks and Regards,


Kapil Bhosale.




click a button to print current window form

how can i click a button to print current window form? i don't know how to set and define something? anyone give me example for my reference   thanks.

Javascript to pass var in iframe to parent form

Why doesn't this form work when the button is clicked? It is inside an iframe. I sent the controls to an iframe from  a different website. When I hover my mouse over the Resubmit button, I can see the correct url in my browser bar. (lower left) This is the same one as the save button. Does the fact that the Resbmit button is in an iframe create a problem?  Is this a security issue?   I was trying to use the Copy url to clipboard button to copy the selected url in the dropdown to the clipboard. Then the user could paste it into the Recipcocal url field in the form and click the Save button again. (see picture) The form is on the page with the iframe. The copy button doesn't work either.  <form name="ctl01" method="post" action="http://www.link-exchangers.com/adv_links_addbycustomer.aspx" id="ctl01" target="hdnFrm"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUaUXIyTcD6f05q0zIbv4QVbpto4s=" /> </div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="//2DwKU+M6MDwK8m8+dCQKy8rjSBwLD+aWMBALcwYfHCALrp+eHDwKggI3ODAKvtqqBBgKjs8y4CAKqiLHeDgK34agCBNfAteTeI3XoiXVXjCs/J0yEnNM=" /> </div>

OK button click on Windows dialogue form not triggering click event

I have created an Add-In for Outlook 2003 in Visual Studio 2005. When a new message is sent and a toggle button is selected, a form that I have created will be displayed as a dialogue box, where further information can be entered. Once this information has been entered you can click the OK button and the message is sent. If you were to click the OK button with invalid data in the form, there would be a message box with an error message. This all works perfectly on my development machine but when I have packaged the Add-In and installed it on other machines it does not work. Clicking on the OK button does nothing, there is not even an error message. All the prerequsits are successfully installed and this is the only part of the Add-In that does not work. All help greatly appreciated. Thanks Nick

Creating a "Save Button" in a browser based Form

I'm not sure if I'm missing something obvious, but I need to have the funtionality of the "Save Button", which is available and works on the tool bar, available in the form...and I can't seem figure out how to do it.I've found examples, in this forum, of how to use the "Submit Button" to act as the "Save Button", which did work for me, but only when specific basic criteria was met.The criteria that I now have is that I'm initiating a workflow to automatically start when a new item is created.  My workflow then moves the form to one of a few possible different form libraries, based on the logic in my workflow.  The different form libraries are to manage different teams of people that would have access to the Form and then that team would process the form accordingly.My specific situation: 1 - User opens a new form (works) 2 - User enters data and then submits the new form (works) 3 - Workflow is initiated and the form is moved to another form library to be worked on by a select group of people (works) 4 - The form is opened and reviewed and some changes are made to the form data by the select group of people (works) 5 - The form data in the form libary is updated (works, but only if the save button is pressed in the tool bar and then manually closes t

Link to .xls but need to pass parameters

 Hi All, I have a page containing a link to to MS Excel spreadsheet (I am able to assume that Excel is available as this is an intranet page). All works fine until I want to pass a parameter into the spreadsheet. Normally I would do this with /e but this will not work I am starting Excel through a link. Any ideas how I would pass the parameters into Excel? (also - there may be multiple requests for the spreadsheet at any time with differing parameters!!)   Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend