yami007 Posted July 23, 2009 Share Posted July 23, 2009 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 Link to comment https://forums.phpfreaks.com/topic/167191-show-layer-by-clicking-on-an-option-from-the-select-button/ Share on other sites More sharing options...
seventheyejosh Posted July 24, 2009 Share Posted July 24, 2009 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 Link to comment https://forums.phpfreaks.com/topic/167191-show-layer-by-clicking-on-an-option-from-the-select-button/#findComment-881658 Share on other sites More sharing options...
yami007 Posted July 24, 2009 Author Share Posted July 24, 2009 oh man i tried it but it ddnt work, i copied the function into the <script></script> tag in the head, and i opened the file then when i click on google or yahoo it does not display anything Link to comment https://forums.phpfreaks.com/topic/167191-show-layer-by-clicking-on-an-option-from-the-select-button/#findComment-881970 Share on other sites More sharing options...
seventheyejosh Posted July 24, 2009 Share Posted July 24, 2009 you did: <script type="text/javascript"> function </script> ? gotta link to the page? also try the java console. lemme know Link to comment https://forums.phpfreaks.com/topic/167191-show-layer-by-clicking-on-an-option-from-the-select-button/#findComment-881994 Share on other sites More sharing options...
KevinM1 Posted July 24, 2009 Share Posted July 24, 2009 Put quotes around the inputs' attributes in the HTML and the word 'block' in the JavaScript and try it again. Link to comment https://forums.phpfreaks.com/topic/167191-show-layer-by-clicking-on-an-option-from-the-select-button/#findComment-882019 Share on other sites More sharing options...
seventheyejosh Posted July 24, 2009 Share Posted July 24, 2009 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 Link to comment https://forums.phpfreaks.com/topic/167191-show-layer-by-clicking-on-an-option-from-the-select-button/#findComment-882077 Share on other sites More sharing options...
yami007 Posted July 27, 2009 Author Share Posted July 27, 2009 you did: <script type="text/javascript"> function </script> ? gotta link to the page? also try the java console. lemme know yes i did Link to comment https://forums.phpfreaks.com/topic/167191-show-layer-by-clicking-on-an-option-from-the-select-button/#findComment-884320 Share on other sites More sharing options...
yami007 Posted July 27, 2009 Author Share Posted July 27, 2009 ok thanks lemme try it Link to comment https://forums.phpfreaks.com/topic/167191-show-layer-by-clicking-on-an-option-from-the-select-button/#findComment-884321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.