Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/add_forge_now/creation_form.html
Show All 39 Lines | <div id="swh-add-forge-submit-request" class="tab-pane active mt-3"> | ||||
</small> | </small> | ||||
</div> | </div> | ||||
<div class="form-group col-md-7"> | <div class="form-group col-md-7"> | ||||
<label for="swh-input-forge-url" class="swh-required-label"> | <label for="swh-input-forge-url" class="swh-required-label"> | ||||
Forge URL | Forge URL | ||||
</label> | </label> | ||||
<input type="text" class="form-control" id="swh-input-forge-url" | <input type="text" class="form-control" id="swh-input-forge-url" | ||||
name="forge_url" required> | name="forge_url" oninput="swh.add_forge.validateForgeUrl(this)" required> | ||||
jayeshv: Can we avoid this validation using URL field in a Django form? That seems to support custom… | |||||
anlambertAuthorUnsubmitted Done Inline ActionsAt the moment we cannot as we do not use django ModelForm the right way (we handled the HTML form ourself instead of "simply" including the django form in the template and we send form data to server through js). Proceeding like this also enables to save an HTTP request to validate form data. anlambert: At the moment we cannot as we do not use django `ModelForm` the right way (we handled the HTML… | |||||
<small class="form-text text-muted"> | <small class="form-text text-muted"> | ||||
Remote URL of the forge. | Remote URL of the forge. | ||||
</small> | </small> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-row"> | <div class="form-row"> | ||||
<div class="form-group col-md-5"> | <div class="form-group col-md-5"> | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |
Can we avoid this validation using URL field in a Django form? That seems to support custom validation as well.