Your Location is: Home > Django

How do I change a field value in Django form based on input? [closed]

From: Togo View: 2005 ssamtkwon 


Let's say I have a form with 3 fields - Book, Title, Author. The user could manually enter the title and the author, but he can also choose a book from the Book field. When a book 'some_title(some_author)' is chosen, I want the Title and Author fields to automatically update to 'some_title' and 'some_author'. Can I do this with only Django/HTML or do I need something else like Javascript? How? I don't know anything about JS, sorry if this is basic stuff.

Best answer