html - Conditional logic form -
I am trying to program a form with some conditional arguments.
Question 1: Do you have a warranty form?
If the visitor presses yes then I want to show the following:
Question 2: Date of purchase?
- Write ur text here
I have already received the code:
Code Question 1
& lt; Div class = "form-section-content2" & gt; & Lt; Div class = "first-label-column-1-gray" & gt; & Lt; Div class = "form-content" & gt; Garantie bewijs meegeleverd * & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "first-label-column-2-gray" & gt; & Lt; Div class = "form-content" & gt; & Lt; Input class = "form-field" type = "radio" name = "garantie" value = "ja" & gt; Go & lt; / Br & gt; & Lt; Input class = "form-field" type = "radio" name = "garantie" value = "nee" & gt; N & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;
Code Question 2
& lt; Div class = "form-section-content1" & gt; & Lt; Div class = "first-label-column-1-white" & gt; & Lt; Div class = "form-content" & gt; Anaphafadatam *
I have tried with some PHP and Javascript but it can not be completed. If you can help me, then it will be nice.
javascript Hope that helps! onchange
whenever the radio button is clicked, run the function Events for After this you can click on and
function display question (answer) {document.getElementById (Answer + 'question'). Style.display = "block"; If (Answer == "Yes") {// Hide the box which the document is not selected. GetElementById ('any questions'). Style.display = "none"; } And if (answer == "no") {document.getElementById ('yes question'). Style.display = "none"; }}
& lt; Form name = "feedback" action = "javascript: void (0)" & gt; & Lt; Label & gt; & Lt; Input type = "radio" id = "yes" name = "yes" no "value =" yes "onchange =" display query (this.value) "/> Yes Gt; & lt; input type = "radio" id = "no" name = "yes" orno "value =" no "onchange =" display query (this.value) "/> not & lt; / Labels & gt; & Lt; Div id = "yes question" style = "display: none;" & Gt; & Lt; Br / & gt; Why did you choose yes? & Lt; Input type = "text" placeholder = "reply here ..." /> & lt; / Div & gt; & Lt; Div id = "noquestion" style = "display: none;" & Gt; & Lt; Br / & gt; Why did not you choose? & Lt; Input type = "text" placeholder = "reply here ..." /> & lt; / Div & gt; & Lt; Br / & gt; & Lt; Br / & gt; Input
Comments
Post a Comment