Skip to content

Commit

Permalink
Merge pull request #1580 from Vanshika7902/addTextBox
Browse files Browse the repository at this point in the history
inputBoxForOtherAdded
  • Loading branch information
akshitagupta15june authored Jun 1, 2024
2 parents 52227ae + 099cb37 commit 876502b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
11 changes: 9 additions & 2 deletions reportstary.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,23 @@ <h1 id="title">Report any Critical stray animal to the nearest Animal Care centr
<label for="email">Which type of stray animal?
<span class="hint text-red-600">*</span>
</label>
<select id="dropdown" name="role" class="form-control" required>
<select id="dropdown" name="role" class="form-control" onchange=addtextbox(this.value) required>
<option disabled selected value>Select stray animal</option>
<option value="student">Dog</option>
<option value="artist">Cat</option>
<option value="graphic_designer">Cow</option>
<option value="other">Pig</option>
<option value="pig">Pig</option>
<option value="other">Other</option>
</select>
</div>

<div class="form-group mb-2 hidden" id="box" >
<label >Other:
<span class="hint text-red-600">*</span>
</label>
<input type="text" name="b" class="form-control" >
</div>

<div class="form-group">
<label>What is the condition of the animal currently?</label>
<label>
Expand Down
12 changes: 11 additions & 1 deletion reportstary.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,14 @@ close.addEventListener("click", () => {
Gobtn.addEventListener("click", Gotopage);

// Change to the stored current theme.
changeToCurrTheme()
changeToCurrTheme()

function addtextbox(val){
let ele = document.getElementById('box');
if(val == "other"){
ele.style.display = 'block';
}
else{
ele.style.display = 'none';
}
}

0 comments on commit 876502b

Please sign in to comment.