Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.