?
Solved

reloading a form using php and including number of feilds depending on selection

Posted on 2003-03-12
7
Medium Priority
?
240 Views
Last Modified: 2008-03-03
i need to reload the page when a option is selected in a menu/list of a html form. i understand how to do the rest, its just getting it to reload when the selection is hit and passing a variable through the url

any ideas??

neil
0
Comment
Question by:neil109
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 6

Expert Comment

by:carchitect
ID: 8118975
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF">
<form method="post" action="">
  <select name="select" onChange="MM_goToURL('parent','gotosame.htm');return document.MM_returnValue">
    <option value="1" selected>Hi</option>
    <option value="2">Reload</option>
  </select>
</form>
</body>
</html>
0
 
LVL 6

Expert Comment

by:carchitect
ID: 8118978
or

<html>
<body>
<form method="post" action="">
  <select name="select" onChange="self.location.href('filename.htm')">
    <option value="1" selected>Hi</option>
    <option value="2">Reload</option>
  </select>
</form>
</body>
</html>
0
 

Author Comment

by:neil109
ID: 8119028
i need to parase the variable thats selected into php so if "html" was selected in the box then it would go to file.php?include=html how would i do that? just add the php into the java?
0
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
LVL 6

Accepted Solution

by:
carchitect earned 300 total points
ID: 8119079
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function move(str)
{
if(str=="1")
  self.location.href="file.php?include=html";
if(str=="2")
  self.location.href="file.php?include=php";
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF">
<form method="post" action="">
 <select name="select" onChange="move(this.value)">
   <option value="1" selected>HTML</option>
   <option value="2">PHP</option>
 </select>
</form>
</body>
</html>
0
 

Author Comment

by:neil109
ID: 8119107
cheers for that saved me hours of racking my brain
0
 
LVL 6

Expert Comment

by:carchitect
ID: 8119142
o thx we are here to share our knowledge
0
 

Author Comment

by:neil109
ID: 8119174
is there a way i can get it to pass all the rest of the form through onto the other page?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question