1

TLDR I am looking to pass the value of an HTML Form Web Part Filter on a Site Page to a Text Field on a New Form, when the New Form is invoked from a button as a modal-popup from the same site page that contains the HTML Form Web Part. How can I do what is happening in the picture below?

enter image description here

Full Question

Optional. For those interested in more clarity on the names, details, and stwp-by-step of this question, feel free to read below.

THE COMPONENTS

  • Site Page It's called 'Launch.aspx'

  • HTML Form Web Part

  • I have an autocomplete script that on my Site Page that populates the HTML Form Web Part with items from List:'Companies', field:'Title'

  • The textbox id is called 'tags' -- see below (it's the script for the textbox for the filter)

    <div class="ui-widget"> <label for="tags">Company Names</label> <div onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_"> <input id="tags" name="tags" input type="text"/<onchange="javascript:_SFSUBMIT_"/> </div>

  • Custom Forms

  • I have (1) custom NewForm for a Task List ('Tasks'), the form url is:'/Lists/Tasks/AddNew.aspx'

  • I have (1) custom EditForm for a Document Library ('DocLibrary'), the form url is: 'DocLibrary/Forms/UpdateForm.aspx'

  • both of these forms can be invoked from the Site Page 'Sites/Launch.aspx'

  • both of these forms have a field called 'CompanyId', which I'd like passed from the value in the HTML Form Web Part ('tags')

  • 'COMPANY' LIST As previously stated, thee HTML Form Web Part autocomplete is populate from list items a List called 'Companies' from the 'Title' field

USE CASE

  • A user enters the Comapny Name 'John Deere' in the HTML Form Web Part Filter and filters the page. Once that value 'John Deere' is passed a filter, the user opens a custom new form from the Site Page. When the form opens, 'John Deere' is the value in the field 'CompanyId' in the custom new form. The user goes back to the Site Page, and invokes a custom edit form. Upon opening the custom edit form, the value 'John Deere' is passed to the field called 'CompanyId'.

Very much appreciated -- please let me know if I can further clarify anything.

  • People do not read long complex questions.. break this up in smaller questions. all I can saynow is: Yes, can be done, requires medior to senior level knowledge of JavaScript and knowledge of the Browser LocalStorage might come in very handy – Danny '365CSI' Engelman Mar 22 '17 at 13:10
  • It's actually a simple question, which has a lengthy explanation in order to mitigate the amount of comments asking for clarification. Unclear to me how it can be broken up into smaller questions, because the bulk of the question is an explanation of all of the components involved (list names, web part names, etc.). Thoughts? – TheJDScott Mar 22 '17 at 13:58
  • Its clear to you. I tried, and halfway quit because I had to try and understand all those components involved – Danny '365CSI' Engelman Mar 22 '17 at 14:08
  • Ok, I just redid the question. How you feel about the improvement? – TheJDScott Mar 22 '17 at 14:30
  • A picture says more than a thousand words.. now I don't have to read anything but your yellow question. You have to reverse your thinking, do not pass a value, the modal needs to read the value. It is not an IFRAME so can easily read that field value. That requires JavaScript in the NewForm.. from medior/senior knowledge I would now say it requires medior knowledge of javaScript – Danny '365CSI' Engelman Mar 22 '17 at 14:58
0

You need to pass the value from the first form as a query string parameter when openning the second form. Then javasacript on the Newform.aspx picks up the value from the query string and places it in the appropriate input control.

  • Thanks for the feedback. Took your advice. If you have a sec, would you mind if I DM you and you can take a look at my script? – TheJDScott May 22 '17 at 15:11
  • sure, no problem – russellg May 22 '17 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.