Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Autofill SharePoint 2010 List Form Textbox Based on Input to Other Textbox

Posted on 2013-05-15
3
1,082 Views
Last Modified: 2013-05-17
Hello,

I have a SharePoint 2010 list with the NewForm and EditForm default forms. We are in an extraordinarily strict environment where we can't use workflows, InfoPath, or anything else besides out of the box (OOTB) SharePoint functionality.

I want to create a second list to serve as a lookup with two columns, representing a one-to-one relationship. These are serial numbers to products. Each serial number only identifies one particular product.

On the main list, the first field will be for the user to enter the serial number. We use column validation to ensure it is entered correctly.

If the users enters a legitimate serial number, we want the list to autofill the name of the product from the second lookup list in a text field several lines below. If the serial number isn't recognized, nothing happens and the user is expected to enter the name of the product on their own. There are rare occasions where the user may enter a serial number for a product not in our database, so we aren't going to strictly validate this.

So, basically, the goal is that the user enters a serial number. I then want to put some sort of JavaScript/JQuery in a CEWP that would look at the OnChange event for the first text box. After focus is lost, etc., it would check against the second list, see if the value is there. If so, it fills the name column. If it can't find it, the form does nothing.

I know there are a bunch of libraries and WSP files out there with custom solutions, like SPServices and their cascading drop-downs. Again, due to our strict requirements, we can't use any of that. The most we are allowed to do is write our own JavaScript code.

Can someone point me to a good link on how to do this?

Thank you,
Joseph Irvine
0
Comment
Question by:jkeagle13
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
clayfox earned 475 total points
ID: 39171252
With SharePoint 2010, InfoPath is the form editor.

once your lists are started, edit the main list, which will pop up in InfoPath.  Then add a data connection to the second list.
Put a rule on the serial number field with an action to set the product name to the name from the second list with a filter of the serial number entered matches the serial number in the list.

this is all standard InfoPath functionality that you can leverage with a list to customize the SP entry/edit form.

www.infopathdev.com is a good resource for getting started.
0
 

Author Comment

by:jkeagle13
ID: 39171737
Is that going to create an XSN and essentially turn it into an InfoPath form? Because, we are using SharePoint out of the box and cannot use InfoPath forms.

So, if InfoPath is able to edit the ASPX file while leaving it in ASPX format, that is fine. We just can't have it creating anything other than ASPX.

Thanks!
0
 
LVL 28

Expert Comment

by:clayfox
ID: 39171768
Yah, InfoPath is embedded in 2010, so the forms are still web based and rendered in the browser.  Other than to maybe edit the input pages, InfoPath is not required and is all hosted.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML5 Looping table certain Cell 11 54
tiny glitch in my main slider 3 38
iframe - style elements within an iframe 7 36
Binding a Grid in Javascript 5 42
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question