[Django]-How to save Django "forms.ModelForm" in database after editing it content and passing a javascript variable to it's new entered field

3👍

Add a hidden field to your ModelForm that will hold the date:

class hostCreateForm(forms.ModelForm):
    class Meta:
        model = filled
        widgets = {
            'user': forms.HiddenInput()
        }
    # additional hidden field
    datetime = forms.DatetimeField(widget=forms.HiddenInput)

You can then assign it a value in the javascript.

Leave a comment