0

Guys plz need a help.

I have index page

<form id="form1" name="form1" method="get" action="show.php">
<select name="cg" onchange="SearchC();" id="catG"  > 
		     <option value="1" >ВСЕ КАТЕГОРИИ</option> 	     
		    <option value="2"<? if($pcat=="2")echo "selected='selected'"; ?>>subject</option> 	
		    <option value="3" <? if($pcat=="3")echo "selected='selected'"; ?>>faculty</option> 
		    <option value="4" <? if($pcat=="3")echo "selected='selected'"; ?>>lecture</option> 		        	
</select>	
</form>

then

function SearchC() {
	var category = $("#catG").val();	
	var query = "searchbox.php?ct="+category;		
	$.ajax({
		url: query,
		success: function(data, textStatus, XMLHttpRequest) {			
			$("#searchcontents").html(data);
			SearchCCallBack(false);			
		}
	});
}

and searchbox.php

<?
if (($_GET['ct'] == '1'))
{
?>				

	
	<select name="subj" id="subj" class="textbox">
	<option value="1"> math </option>
        <option value="2"<? if WHAT TO WRITE HERE echo "selected='selected'";?>>phys</option>
	</select>	
<?php
} ?>

how i can pass certain options "SELECTED" to show.php from searchbox.php. how to display everything in show.php?

values from form1 m passing like -> if (isset($_GET)){$pcat=$_GET;}

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Juriy
0

then Im moving to show.php i need to show appropriate cg and subj which I selected in index.php.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.