jkeagle13
asked on
Autofill SharePoint 2010 List Form Textbox Based on Input to Other Textbox
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
ASKER
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!