<div> <label for="body">Review (required)</label> <textarea id="body" name="body" maxlength="1200" placeholder="Share your experience..."></textarea> <div class="small"><span id="bodyCount">0</span>/1200</div> </div>

function hoverStars(n) stars.forEach(s => s.classList.toggle('active', Number(s.dataset.value) <= n)); function updateStars() stars.forEach(s => s.classList.toggle('active', Number(s.dataset.value) <= currentRating)); ratingValue.textContent = currentRating;

<div> <label>Primary category (required)</label> <select id="primaryCategory" required> <option value="">Select category</option> <option>Accommodation</option> <option>Food & Dining</option> <option>Tour / Guide</option> <option>Transport</option> <option>Attraction / Activity</option> <option>Other</option> </select> </div>

// image previews const imagesInput = document.getElementById('images'); const imagePreview = document.getElementById('imagePreview'); imagesInput.addEventListener('change', () => imagePreview.innerHTML = ''; Array.from(imagesInput.files).slice(0,6).forEach(file => const img = document.createElement('img'); img.className = 'preview-img'; img.alt = file.name; const reader = new FileReader(); reader.onload = ev => img.src = ev.target.result; reader.readAsDataURL(file); imagePreview.appendChild(img); ); );

stars.forEach(s => s.addEventListener('click', () => currentRating = Number(s.dataset.value); updateStars(); ); s.addEventListener('mouseover', () => hoverStars(Number(s.dataset.value))); s.addEventListener('mouseout', () => updateStars()); );

<div> <label>Would you recommend?</label> <div class="row"> <label><input type="radio" name="recommend" value="yes" /> Yes</label> <label><input type="radio" name="recommend" value="no" /> No</label> <label><input type="radio" name="recommend" value="unsure" checked /> Unsure</label> </div> </div>

<div> <label for="title">Review title</label> <input id="title" name="title" type="text" maxlength="80" placeholder="Short headline (max 80 chars)" /> <div class="small"><span id="titleCount">0</span>/80</div> </div>

<div class="row"> <div style="flex:1"> <label for="visitDate">Visit date (optional)</label> <input id="visitDate" type="date" /> </div> <div style="flex:1"> <label for="location">Location (optional)</label> <input id="location" type="text" placeholder="e.g., Srinagar, Gulmarg" /> </div> </div>