ram1
ram1

Reputation: 6470

Django slugify text input

How do I take the value entered in a textbox and slugify it before sending it though the form? This doesn't work:

<input type="text" value="{{something|slugify}}" />

Upvotes: 1

Views: 253

Answers (1)

bradley.ayers
bradley.ayers

Reputation: 38382

Use JavaScript, or add a clean_FOO method to your form to sanitise (slugify in your case) your input data.

Upvotes: 1

Related Questions