populate default value on the page after each page postback

Feb 3, 2012 at 3:04 PM

Hi Patrick,

I have downloaded the LFMF and installed into my SharePoint 2010 environment. Everything works as expected. I really appreciate you sharing the fantastic work with us. Now I have one question below,

I created a custom list form called MyNewForm.aspx followed this article http://ikarstein.wordpress.com/2010/12/29/walkthrough-create-custom-sharepoint-2010-list-form-for-deployment-in-a-visual-studio-2010-project/ I have a STATE listbox and a couple of textbox fields such as State_Tax, City_Tax, … on this page. Using your LFMF feature helps me well to populate the default values when the page loaded. It works exactly as your article described. 
 
Once user select a different state from the STATE list box, I want those textbox get populated again based on the selected state value. What I am missing here is that I am not sure how to find out the STATE listbox control (set the postback attribute to true) and its associate onchange event from the code behind page so that I can write the business logic in the code behind page to retrieve data for the selected State. Once the page reload after the postback, it will automatically call your LFMF feature again and populate new data to those textbox controls, such as State_Tax, City_Tax, ...
 
Thanks in advance,

Peter

Coordinator
Feb 3, 2012 at 3:15 PM

Hi Peter,

thank you for your feedback. I am sure that you can accomplish your requirement by using jQuery change (http://api.jquery.com/change/). Nonetheless, I will prepare an example for you and expand the framework accordingly. Please give me a little time to do it for you. I hope to be able to manage it within the next days.

 

br,

patrick

Coordinator
Feb 10, 2012 at 5:25 AM

Hi Peter,

there is a Codeplex Project that you might be able to reuse for that purpose. This creates for you cascading dropdowns: http://spservices.codeplex.com/wikipage?title=$().SPServices.SPCascadeDropdowns. This should work in your scenario and does not require any postbacks. You find a good example on that page.

Please check the first page of the project. There is a different requirement for jQuery. LFMF currently does not care wich jQuery version is used, therefore you might disable the jQuery module of LFMF and use the jQuery module of the SPServices.

 

br,

patrick