homepage Welcome to WebmasterWorld Guest from 54.166.53.169
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Problem with ajax call
Juriy



 
Msg#: 4347150 posted 1:58 pm on Aug 3, 2011 (gmt 0)

Guys plz need a help.

index page

<form id="form1" name="form1" method="get" action="show.php">
<select name="cg" onchange="SearchC();" id="catG" >
<option value="1" >&#1042;&#1057;&#1045; &#1050;&#1040;&#1058;&#1045;&#1043;&#1054;&#1056;&#1048;&#1048;</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
} ?>



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

value for "cg" m passing like -> if (isset($_GET['cg'])){$pcat=$_GET['cg'];}

How to pass and make selected "subj" value in show.php?

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved