zaggazow wrote:I would like to display a form on a page, but only if a person choses a particular option.
I would like to avoid sending my user to a new page to enter his/her information in this form.
How could PHP be used to do this(if possible) and what elements could be used to provide the user with the options, example,
could i just put an image button that causes the form to be diplayed when clicked, could i use options from a flyout menu.
I would like the element used to provide the option to display the form be very accessible.
Thanks in advance for your response.
ALL SUGGESTIONS WELCOMED.
This is how i would do it;
1- insert javascript on your document's head tag
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->
</script>
2- create a div and make it style display none and give it an id;
<div id="your_id" style='display:none';>Your form goes here</div>
3-if you want to use an image to activate the form (to display it) do it like this;
<a href="#" onClick="toggle_visibility('your_id');">Your image source </a>
Thats what i do when i need to do something like what you need.
Cheers.