Jump to content

show [layer] by clicking on an option from the select button


yami007

Recommended Posts

I wanna know how the new user knew about my web site, so i made a select button ==> by google, yahoo,friend,other

so when they click other option, i want to display a hidden input..

i hope i explained it right, and hoping for your help again  :)

you can't show a literal 'hidden' input as far as i know. you can just toggle something with an input in it tho:

 

<input type=radio name=how value=google onclick="show('g');">Google</input>
<input type=radio name=how value=yahoo onclick="show('y');">Yahoo</input>

<div style="display:none;" id="g">
     Oh really? Google? Tell us more <textarea> 
</div>

<div style="display:none;" id="y">
     Oh really? Yahoo? Tell us more <textarea> 
</div>

with js of:

function show(which){

     document.getElementById(which).style.display=block;

}//end function

 

that'll toggle the div display. You'll have to tweak it some to hide that div and show the others of course, if the user changes there mind. or you can disable the radio. either way.

 

lemme know

oh snap i dropped the ball on the block tags. sorry bout that. if there are no quotes it is trying to set it to the value of the variable block. which doesnt exist.... so document.getElementById(which).style.display="block";

 

sorry :(

 

good catch nightslyr

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.