Page 1 of 1
hiding a form, in the style of a drop-down menu?
Posted: Sat May 15, 2010 9:36 pm
by Age of Fable
In my game I have a form, which is used if the player wants to gamble. It lets them enter the details (how much to bet, how many bets etc).
I want to have a link, eg "adjust gambling" which, if it's clicked, will make the form come up (and if pressed again will make it disappear).
I could obviously do it as a link or have a popup window, but I was wanting to have it on the same page.
I found some javascript which does similar menus, but it turns every line into a link, so it wouldn't work for the form.
Re: hiding a form, in the style of a drop-down menu?
Posted: Sat May 15, 2010 9:45 pm
by KunoNoOni
If you made a div there is a option that you can have set the visibility
Check it out here
hope this helps
-KunoNoOni
Re: hiding a form, in the style of a drop-down menu?
Posted: Sun May 16, 2010 9:49 am
by Chris
Code: Select all
<a href="javascript: document.getElementById('hiddenDiv').style.visibility='visible'; void 0;">Show div</a>
<div id="hiddenDiv" style="visibility: hidden; height: 200px; width: 200px; border: #000 1px solid; padding: 20px;">
<a href="javascript: document.getElementById('hiddenDiv').style.visibility='hidden'; void 0;">Hide div</a>
</div>
Re: hiding a form, in the style of a drop-down menu?
Posted: Sun May 16, 2010 11:24 am
by PaxBritannia
If I understand correctly:
There is a form.
But if a player wants to alter the settings "e.a. adjust gambling", he clicks a link, and then a form appears, the form being on the same page (not a pop up). The player then enter the stuff into the form and presses "submit/return/etc."He then returns to the initial form.
When he then submits this initial form, both sets of info from both forms are submitted.
If it is, that would need javascript. It should be easy. But I don't have time to do write an example now, I have an assignment due tomorrow.
Pax.
Re: hiding a form, in the style of a drop-down menu?
Posted: Sun May 16, 2010 12:46 pm
by hallsofvallhalla
why would it turn every line into a link?? you can just </a> where you want the link to stop. Maybe I am not understanding what you mean by that.
There are many options to do this, Chris has a very good one with make it visible and invisible.
Re: hiding a form, in the style of a drop-down menu?
Posted: Sun May 16, 2010 3:57 pm
by Age of Fable
KunoNoOni wrote:If you made a div there is a option that you can have set the visibility
Check it out here
hope this helps
-KunoNoOni
I wanted something similar to this, except the user can click the paragraph on and off (ie there's a heading which says, for example, "show form" or "hide form")
Re: hiding a form, in the style of a drop-down menu?
Posted: Mon May 17, 2010 7:30 pm
by Noctrine
Re: hiding a form, in the style of a drop-down menu?
Posted: Tue May 25, 2010 11:20 pm
by Age of Fable
Thanks.