the variable divid is the variable for the dynamic link which should be displayed only when user selects a value from drop down.
CODE
<script type="text/javascript">
function dss_addLoadEvent(fn) {
if(typeof(fn)!="function")return;
var tempFunc=window.onload;
window.onload=function() {
if(typeof(tempFunc)=="function")tempFunc();
fn();
}
}
dss_addLoadEvent(function() {
var f = document.getElementById('request');
var b1 = document.getElementById("cat1");
var b2 = document.getElementById("cat2");
var b3 = document.getElementById("cat3");
// to prevent the form from submitting in this demo
//f.onsubmit = function(){ return false; }
// hide the textarea and its parent label
document.getElementById('broch').style.display = 'none';
// get a reference to the select button group
var sel = document.getElementById('category');
for(var i=1;i<sel.length;i++) {
// we add the event handler to each button in the group
sel.options[i].onkeyup=sel.options[i].selected=function(){
if(sel.options[i].value=='None') return;
var el = document.getElementById('divid');
if((sel.options[i].value=='cat1')|| (sel.options[i].value=='cat2') || (sel.options[i].value=='cat3'))
el.style.display = '';
}
sel.options[i].onclick();
}
});
</script>
function dss_addLoadEvent(fn) {
if(typeof(fn)!="function")return;
var tempFunc=window.onload;
window.onload=function() {
if(typeof(tempFunc)=="function")tempFunc();
fn();
}
}
dss_addLoadEvent(function() {
var f = document.getElementById('request');
var b1 = document.getElementById("cat1");
var b2 = document.getElementById("cat2");
var b3 = document.getElementById("cat3");
// to prevent the form from submitting in this demo
//f.onsubmit = function(){ return false; }
// hide the textarea and its parent label
document.getElementById('broch').style.display = 'none';
// get a reference to the select button group
var sel = document.getElementById('category');
for(var i=1;i<sel.length;i++) {
// we add the event handler to each button in the group
sel.options[i].onkeyup=sel.options[i].selected=function(){
if(sel.options[i].value=='None') return;
var el = document.getElementById('divid');
if((sel.options[i].value=='cat1')|| (sel.options[i].value=='cat2') || (sel.options[i].value=='cat3'))
el.style.display = '';
}
sel.options[i].onclick();
}
});
</script>
How do I make this visible and remain in page?










