Jump to content

creating multiple forms


barefootedboy

Recommended Posts

Hi there , i wonder if someone can help or point me in the right direction (A tutorial or something )

I am a newbe and what i am trying to  do is create a form that start off with a number of options (3)  depending on what the user chooses this will lead them to  another , more comprehensive form , i am trying to  avoid having one long form  that will put people off ... rather allowing them to  to go directly to the form that is relevant to  them , i have already created these forms i just need to  know how to  make the initial form ( the php for this )  I am as i said a novice  so if somebody knows of a tutorial in this direction that would be great .. i am aware that there may be a very easy answer to  this so please feel free to  laugh at me  should you feel the urge

 

kind regards

 

Sebastian 

Link to comment
Share on other sites

You could use a dropdown list and let the user select a choice, and then direct them to the specified page.

<select>
<option onclick="javascript:document.location = 'relavant_page1.php'">Option 1</option>
<option onclick="javascript:document.location = 'relavant_page2.php'">Option 2</option>
<option onclick="javascript:document.location = 'relavant_page3.php'">Option 3</option>
</select>

 

Edit: Something as javascript can be used to display the form on the same page.

<script language="javascript">
function show(id,select) {
document.getElementById(select).style.display = "none";
document.getElementById(id).style.display = "block";
}
</script>

<select id="select">
<option onclick="javascript:show('one','select')">Option 1</option>
<option onclick="javascript:show('two','select')">Option 2</option>
<option onclick="javascript:show('three','select')">Option 3</option>
</select>

<div id="one" style="display:none">Form One</div>
<div id="two" style="display:none">Form Two</div>
<div id="three" style="display:none">Form Three</div>

Link to comment
Share on other sites

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.