Home > other >  Django form input box the default prompt how to do
Django form input box the default prompt how to do

Time:11-19

 & lt; Input type="text" value="https://bbs.csdn.net/topics/E-mail address an onfocus"="this.valuehttps://bbs.csdn.net/topics/=';" Onblur="if (this. Value='https://bbs.csdn.net/topics/={this.valuehttps://bbs.csdn.net/topics/=' E-mail address; } "& gt; 

Form input box in the edit state, there will be a guide information prompt, in the edit state automatically to empty, as is the implementation of HTML, want to django forms should be how to do?
Tried the initial, not the desired effect, this is a direct when the default value,

CodePudding user response:

The input of the placeholder is not to do this thing, and django what relation

CodePudding user response:

reference 1st floor nieoding response:
input the placeholder is not to do this thing, and what's your django

Now is made form the django ah, so was asking how django to implementation,

CodePudding user response:

CodePudding user response:

refer to the second floor migoumigou response:
Quote: refer to 1st floor nieoding response:

Input the placeholder is not to do this thing, and what's your django

Now is made form the django ah, so was asking how django to implementation,


The form widgets to achieve

 
The class SearchForm (forms. The Form) :
Idcard=forms. CharField (required=False, widget=forms. ((attrs={' class ':' form - control ', 'placeholder' : 'name/phone number/id number}))

CodePudding user response:

reference 4 floor nieoding response:
Quote: refer to the second floor migoumigou response:

Quote: refer to 1st floor nieoding response:

Input the placeholder is not to do this thing, and what's your django

Now is made form the django ah, so was asking how django to implementation,


The form widgets to achieve

 
The class SearchForm (forms. The Form) :
Idcard=forms. CharField (required=False, widget=forms. ((attrs={' class ':' form - control ', 'placeholder' : 'name/phone number/id number}))


Alas, too food, still have to go for it, the original widget can be easily done, thank you greatly

CodePudding user response:

reference 4 floor nieoding response:
Quote: refer to the second floor migoumigou response:

Quote: refer to 1st floor nieoding response:

Input the placeholder is not to do this thing, and what's your django

Now is made form the django ah, so was asking how django to implementation,


The form widgets to achieve

 
The class SearchForm (forms. The Form) :
Idcard=forms. CharField (required=False, widget=forms. ((attrs={' class ':' form - control ', 'placeholder' : 'name/phone number/id number}))

oh, turned out to be so!
  • Related