waleed82 Posted February 3, 2013 Share Posted February 3, 2013 Sir I m facing problem in Multiple Select Options using Ajax plz help me out .. I m posting code plz help me Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/ Share on other sites More sharing options...
waleed82 Posted February 3, 2013 Author Share Posted February 3, 2013 <?php include("database.php"); class SendSms{ public function viewDeptName(){ $result=database::getdepartment(); $rows=mysql_num_rows($result); echo("<center> <h3> Sms Sending </h3> </center>"); echo("<center><table border='2'>"); echo("<form action='http://localhost/smspctomobile/SendSms.php' method=post>"); echo("<tr> <td> Department: </td>"); echo("<td> <select name=deptId onchange='this.form.submit();'> "); echo("<option> select department </option>"); $i=0; while($i<$rows){ $id=mysql_result($result,$i,"dept_id"); $name=mysql_result($result,$i,"dept_name"); echo("<option value=$id>$name</option> "); $i++; }//end loop echo("</select> </td> </tr>"); echo("</form>"); }//end department Name public function viewProgram($deptId){ $result=database::getProgram($deptId); $rows=mysql_num_rows($result); echo("<form action='http://localhost/smspctomobile/SendSms.php' method=post>"); echo("<tr> <td> Program: </td>"); echo("<td> <select name='progId' onchange='this.form.submit();'>"); echo("<option> Select Program </option> "); $i=0; while($i<$rows){ $id=mysql_result($result,$i,"prog_id"); $name=mysql_result($result,$i,"prog_name"); echo("<option value=$id>$name</option>"); $i++; }//end loop echo("</select> </td> </tr>"); echo("</form>"); } // end viewProgram public function viewBatch($progId){ $result=database::getBatch($progId); $rows=mysql_num_rows($result); echo("<form action='http://localhost/smspctomobile/SendSms.php' method=post>"); echo("<tr> <td> Batch: </td>"); echo("<td> <select name=batchId onchange='this.form.submit();'>"); echo("<option> Select Batch </option> "); $i=0; while($i<$rows){ $id=mysql_result($result,$i,"batch_id"); $name=mysql_result($result,$i,"batch_name"); echo("<option value=$id>$name</option>"); $i++; }//end loop echo("</select> </td> </tr>"); echo("</form>"); } // end viewBatch public function viewBatchShift($batchId){ $result=database::getBatchNameAndShift($batchId); $rows=mysql_num_rows($result); echo("<form action='http://localhost/smspctomobile/SendSms.php' method=post>"); echo("<tr> <td> Batch Shift: </td>"); echo("<td> <select name=batchId2 onchange='this.form.submit();'>"); echo("<option>Select Shift</option> "); $id=mysql_result($result,0,"batch_id"); $shift=mysql_result($result,0,"batch_shift"); echo("<option value=$id>$shift</option>"); echo("</select> </td> </tr>"); echo("</form>"); } // end viewBatchShift public function selection($batchId2){ echo("<tr> <td> Select Procedure: </td>"); echo("<form action='http://localhost/smspctomobile/SendSms.php' method=post>"); echo("<td> <select name='selc' onchange='this.form.submit();'>"); echo("<option >Select</option> "); echo("<option value='multi'> Multiple </option>"); echo("<option value='all'> Send To All </option>"); echo("</select></td></tr>"); echo("<input type='hidden' name='batchId3' value='$batchId2'>"); echo("</form>"); } // end method selection public function viewStudentNum($batchId3){ echo($batchId3."<br>"); echo("<form action='http://localhost/smspctomobile/sms.php' method=post>"); echo("<tr> <td> Write Sms: </td> <td> <textarea rows='5' cols='35' name='message'>"); echo("</textarea> </td> </tr>"); echo("</table> <br>"); echo("<input type='submit' value='Send'>"); echo("</form"); echo("</center>"); } // end viewStudentNum public function sendMsg($batchId3){ echo($batchId3."<br>"); $result=database::getStudents(); $rows=mysql_num_rows($result); echo("<form action='http://localhost/smspctomobile/checkboxSMS.php' method=post>"); echo("<tr rowspan='4'> <td> Student Number: </td> <td colspan='2'>"); $i=0; while($i<$rows){ $id=mysql_result($result,$i,"std_id"); $number=mysql_result($result,$i,"std_number"); $roll=mysql_result($result,$i,"std_rollNum"); echo("<input type='checkbox' name='numbers[]' value=$id>$roll<br/>"); $i++; } // end loop echo("</td> <input type='text' name='message'>"); echo("<input type='submit' name='submit' value='Submit'/>"); echo("</form>"); } // sendMsg Multiple }//end class SendSms $ob=new SendSms(); $ob->viewDeptName(); $deptId=$_POST['deptId']; $ob->viewProgram($deptId); $progId=$_POST['progId']; $ob->viewBatch($progId); $batchId=$_POST['batchId']; $ob->viewBatchShift($batchId); $batchId2=$_POST['batchId2']; $ob->selection($batchId2); $selc=$_POST['selc']; if($selc=="multi"){ echo("<br> MULTI"); $batchId3=$_POST['batchId3']; $ob->sendMsg($batchId3); } else if($selc=="all"){ echo("<br> ALL"); $batchId3=$_POST['batchId3']; $ob->viewStudentNum($batchId3); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409868 Share on other sites More sharing options...
waleed82 Posted February 3, 2013 Author Share Posted February 3, 2013 Here iz the code wher i want to use Ajax in these Select Options so that page will not load Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409869 Share on other sites More sharing options...
waleed82 Posted February 3, 2013 Author Share Posted February 3, 2013 Im Uploading a file in this i want to use Ajax in Select Option so that on every selection page will not load.. plz help me out program1.php Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409876 Share on other sites More sharing options...
PFMaBiSmAd Posted February 3, 2013 Share Posted February 3, 2013 Stop creating threads for your question. Since it's possible that you started this thread before you were issued the warning about hijacking the previous thread and you didn't see the warning, I won't issue a second warning for double-posting. This thread will be merged with your existing thread for this question... Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409878 Share on other sites More sharing options...
waleed82 Posted February 3, 2013 Author Share Posted February 3, 2013 SO WHAT IS THE WAY TO ASK Question ???? Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409879 Share on other sites More sharing options...
waleed82 Posted February 3, 2013 Author Share Posted February 3, 2013 (edited) SO WHAT IS THE WAY TO ASK Question ???? Edited February 3, 2013 by waleed82 Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409881 Share on other sites More sharing options...
Jessica Posted February 3, 2013 Share Posted February 3, 2013 You need to explain: - What *exactly* you want to happen - What *does* happen - What you have done to troubleshoot it. And only post the RELEVANT code, using code tags. Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409882 Share on other sites More sharing options...
waleed82 Posted February 3, 2013 Author Share Posted February 3, 2013 i want to do that is .. when i select Department dan in other Select Tag programs Open after that select Any One Program another Select Tag Batch open.. & so 0n Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409884 Share on other sites More sharing options...
waleed82 Posted February 3, 2013 Author Share Posted February 3, 2013 Anyy 0ne plz help me out :'( Quote Link to comment https://forums.phpfreaks.com/topic/273987-multiple-dropdown-boxes/#findComment-1409930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.