I have a list that has fields like, name, position, year of birth. This information is stored in a database (read only).

When a user opens list's form (an OOTB form) , I want to go to the database, get the information and fill the fields. My workaround is to make a webpart that will get the information and then add javascript code like:

< script >
 var name = "myname";
 var postion = "thatposition"
< /script>

Then, a jquery will get these values, fill up the textboxes and make them readonly.

I wonder if there's another way. Javaqscript that talks to the sql server directly is not feasible.

  • Can you use InfoPath? – Malin De Silva Sep 10 '14 at 16:58
  • I prefer NOT to use Infopath. – XristosK Sep 10 '14 at 19:05

Exposing the data sources directly through JavaScript is not recommended. You can customize the form using InfoPath or a Visual Webpart and replace the new item form with the visual webpart.

| improve this answer | |

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.