Reputation:
I have two signup pages, student view, and parent view. The default signup url is on the student page http://127.0.0.1:8000/account/student-sign-up/. However, when the parent button is pressed the page redirects to an unknown url at http://127.0.0.1:8000/account/student-sign-up/parent_sign_up.html. I was wondering how to make the button redirect to just http://127.0.0.1:8000/account/parent-sign-up, without the student-sign-up prefix.
HTML
<!-- Radio check 1 -->
<div class="form-check form-check-inline radio">
<label class="form-check-label">
<input class="form-check-input" type="radio" name="radios" id="radio1" onclick="document.location.href='student_sign_up.html'"
checked /> Individual
</label>
</div>
<!-- Radio check 2 -->
<div class="form-check form-check-inline radio">
<label class="form-check-label">
<input class="form-check-input" type="radio" name="radios" id="radio2" onclick="document.location.href='parent_sign_up.html'"
/> Parent of a child under 13
</label>
</div>
urls.py
urlpatterns = [
path('login/', views.login_view, name='login'),
path('student-sign-up/', views.student_sign_up, name='student_sign_up'),
path('parent-sign-up/', views.parent_sign_up, name='parent_sign_up'),
path('teacher-sign-up/', views.teacher_sign_up, name='teacher_sign_up'),
path('reset-password/', views.reset_password, name='reset_password'),
path('reset-password-after/', views.reset_password2, name='reset_password_after'),
Upvotes: 1
Views: 159
Reputation: 2159
Change your both inputs as follows:
<input class="form-check-input" type="radio" name="radios" id="radio1" onclick="document.location.href='/account/student-sign-up/'"
checked /> Individual
<input class="form-check-input" type="radio" name="radios" id="radio2" onclick="document.location.href='/account/parent-sign-up/'"
/> Parent of a child under 13
Upvotes: 1