I hope this helps others. I processed it in javascript. I wrote javascript code to show the next button on the right side of each input and select controls. When the user clicks the next button, he goes to the next control. I wrote the following code for this:
//Move to next crontrol bock var MOVE_TO_NEXT_ID = 'aNext86332'; function bindNext() { var allTags = document.getElementsByTagName('*'); for (var intEle = 0; intEle < allTags.length; intEle++) { if (allTags[intEle].tagName.toLowerCase() == 'input' || allTags[intEle].tagName.toLowerCase() == 'textarea' || allTags[intEle].tagName.toLowerCase() == 'select') { allTags[intEle].addEventListener("focus", function () { //find next input var nextFocus = null; var all = document.getElementsByTagName('*'); var flag = 0; for (var j = 0 ; j < all.length; j++) { if (flag == 1) { if (all[j].tagName.toLowerCase() == 'input' || all[j].tagName.toLowerCase() == 'textarea' || all[j].tagName.toLowerCase() == 'select') { var t = allTags[j]; try { if (t.style.display == 'none') { continue; } else if (t.parentElement.style.display == 'none') { continue; } else if (t.parentElement.parentElement.style.display == 'none') { continue; } else if (t.parentElement.parentElement.parentElement.style.display == 'none') { continue; } else { nextFocus = allTags[j]; break; } } catch (e) { } } } if (this.id == all[j].id) { flag = 1; } } showNext(this, nextFocus); }); allTags[intEle].addEventListener("blur", function () { removeNext(this); }); } } } function moveToNextControl(me, nextObj) { if (nextObj != null) { nextObj.focus(); nextObj.scrollIntoView(true); } } function removeNext(me) { setTimeout(function () { try { var next = document.getElementById(MOVE_TO_NEXT_ID); me.parentElement.removeChild(next); } catch (e) { } }, 300); } function showNext(me, nextObj) { setTimeout(function () { var next = document.createElement("a"); next.className = 'btn btn-default animated fadeIn'; next.innerHTML = 'Next'; next.style.position = 'absolute'; next.style.zIndex = 1; next.style.top = '0'; next.id = MOVE_TO_NEXT_ID; next.style.left = (me.clientWidth - 40) + 'px'; next.addEventListener("click", function () { moveToNextControl(me, nextObj); }); me.parentElement.appendChild(next); }, 500); } //End of Move to next crontrol bock
then the bindNext function is called as follows:
window.onload = function () { bindNext(); }
Manpreet singh dhillon
source share