Jump to content

saravanataee

Members
  • Posts

    25
  • Joined

  • Last visited

saravanataee's Achievements

Member

Member (2/5)

0

Reputation

  1. Dear all, I have a php page in which i have three div's. Each one has a query and set of results which i display row by row inside the div. My div3 is the one will have more records say 150 rows. So, i wanna apply pagination such that 4 records will be shown in each page. But, i would i go about applying single pagination that will be applied for all the three div's. becuz we input numbers of records returned by a query to pagination counter. But since i had three queries which one to be assiged. Might be div3 that has large records. But not sure.. Please help me on this. <?php $subcat=$_REQUEST['subcat']; include_once('inc/dbConnect.inc.php'); include_once('inc/pagination.inc.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>TopAds India</title> <link href="default.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="js/sprite.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("ul#nav li a").css({"opacity" : 0}).hover(function(){ $(this).stop().animate({"opacity" : 1}, 200); //Change fade-in speed }, function(){ $(this).stop().animate({"opacity" : 0}, 100);//Change fade-out speed }); }); </script> <script type="text/javascript" language="javascript" src="js/jquery.suSlider.js" ></script> <script type="text/javascript" language="javascript" > $(document).ready(function(){ loop(); function loop(){ $('#sildercontent').suSlider({ mode: 'slide', speed: 1500, select:12000, auto:true, wrapper_class: 'portfolio_container' }); } //On mouseover stop the slider $("#sildercontent").mouseover(function() { $(this).stop(); return false; }); //On mouseout start the slider $("#sildercontent").mouseout(function() { loop(); }); }); </script> </head> <body onload="changePagination('0','first')"> <div id="wrap"> <div id="header"> <table align="center" width="905px" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table align="center" width="905px" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="174" valign="top" style="padding-top:10px;"><img src="images/logo.png" alt="TopAdsIndia" /></td> <td width="313" valign="top"><img src="images/logo_txt.png" alt="." width="313" height="128" /></td> <td width="418" align="right" valign="bottom" style="padding-right:0px;"><a href="post.php?post_type=1"><img src="images/post_free.png"alt="." border="0" width="168" height="53" /></a></td> </tr> </table> </td> </tr> <tr> <td> <table align="center" width="905px" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <div id="page-wrap"> <div id="content"> <ul id="nav"> <li class="home"><a href="index.php">Home</a></li> <li class="aboutus"><a href="#">About Us</a></li> <li class="highlight_ads"><a href="highlighted.php">Highlight Ads</a></li> <li class="premium_ads"><a href="premium.php">Premium Ads</a></li> <li class="gallery_ads"><a href="gallery.php">Gallery Ads</a></li> <li class="contact"><a href="contact_us.php">Contact Us</a></li> </ul> </div> </div> </td> </tr> </table> </td> </tr> </table> </div> <div id="main"> <table align="center" width="905" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="740" valign="top"><table align="left" width="740" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="740"><table align="left" width="740" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="740"> </td> </tr> <tr> <td width="740" style="padding-left:20px; padding-bottom:10px;"><h2>Premium Ad's</h2></td> </tr> <tr> <td> <div id="table1"> <?php require('config.php'); $query="select * from temp_ad_table WHERE post_type=3 AND Subcategory='$subcat'"; $result=mysql_query($query); if(mysql_num_rows($result)==0 ){ echo '<font color="red" size="5">No Post Found in this Category</font>'; }else { while($row = mysql_fetch_assoc($result)) { ?> <?php $id=$row['ad_id'];?> <div class="premium-listingpagePosts"> <div class="premium-listingpagePostsLeft"> <img src="<?php echo $row['image_location']; ?>"> </div> <div class="premium-listingpagePostsRight"> <div class="premiumslider-postsHeading"><a href="view.php?ad_id=<?php echo $id; ?>""><?php echo $row['Name'];?></a></div> <div class="premium-postsDesc"> <p> <b>Description:</b><?php echo substr(strip_tags($row['AddtionalDt']), 0, 100). "......"; ?> </p> </div> </div> <div class="premium-listingpagePostsRight2" style="vertical-align:top;"> <img src="images/Premium_Ad.png" alt="Premium Ads" border="0"> </div> </div> <div class='clear'></div> <?php } } ?> </div> </div> </div> <div id="table2"> <h2>Highlighted/Free Ad's</h2><br/> <div style="border:2px solid #343233;"> <div id="pageData2" > <?php $query1="select * from temp_ad_table"; $res1=mysql_query($query1); $count1=mysql_num_rows($res1); if($count1 > 0) { $paginationCount=getPagination($count1); } if(isset($_GET['page'])) { $pageLimit = ($_GET['page'] - 1) * 5; } else { $pageLimit = 0; } $query2="select * from temp_ad_table WHERE Subcategory='$subcat' AND (post_type=2 OR post_type=1) ORDER BY `post_type` DESC, `Date` DESC limit $pageLimit,5"; $res2=mysql_query($query2); $count2=mysql_num_rows($res2); if($count2 > 0){ while($row2=mysql_fetch_array($res2)){ $ad_id = $row2['ad_id']; $AdName=$row2['Name']; $addtitle=$row2['AddTitle']; $description=$row2['AddtionalDt']; $location=$row2['Location']; $image=$row2['image_location']; $h_ads = 'yellow'; $post_type=$row2['post_type']; if($post_type == 1) { $h_ads = 'style="background: #e8e8e8;"'; //$h_ads = '<span class='freeads-listingpagePosts'>' ; //$h_ads .= '</span>'; //$h_ads = "<span class='freeads-listingpagePosts'></span>"; } ?> <div class="highlight-listingpagePosts" <?php echo $h_ads; ?>> <div class="highlight-listingpagePostsLeft"> <img src="<?php echo $image; ?>"> </div> <div class="highlight-listingpagePostsRight"> <div class="highlight-postsHeading"> <?php if($post_type==2){?> <a href="view2.php?ad_id=<?php echo $ad_id; ?>"><?php echo $AdName; ?></a> <?php } else {?> <a href="view3.php?ad_id=<?php echo $ad_id; ?>"><?php echo $AdName; ?></a> <?php } ?> </div> <div class="highlight-postsDesc"><?php echo substr(strip_tags($row2['AddtionalDt']), 0, 100). "......"; ?></div><br/> </div><br/> </div> <div class='clear'></div> <?php }} else{ echo '<font color="red" size="5">No Post Found in this Category</font>'; } ?> </div> <?php if($count2 > 0){ ?> <div id="pag"><ul> <li class='first link' id="first"><a href="dashboard.php">First</a></li> <?php for($i=1;$i<$paginationCount+1;$i++){ ?><li class='link'><a href="?page=<?php echo $i; ?>"><?php echo $i;?></a></li><?php } ?> <li class='last link' id="last"><a href="?page=<?php echo $i-1; ?>">Last</a></li> <li class="flash"></li> </ul></div><br><br> <?php } ?> </div> </div> </td> </tr> </table> </td> </tr> </table></td> <td width="165" valign="top"><table width="165px" align="right" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr><td style="padding-bottom:10px;"><h2>Gallery Ad's</h2></td></tr> <tr> <td style="background-color:#cceaee; -webkit-border-radius: 10px; -moz-border-radius: 10px;border-radius: 10px; height:900px; padding-top:10px;" valign="top"> <div id="table3"> <?php $query3="select * from temp_ad_table WHERE post_type=4 AND Subcategory='$subcat'"; $res3=mysql_query($query3); $count3=mysql_num_rows($res3); if($count3 > 0){ while($row3=mysql_fetch_array($res3)){ $ad_id = $row3['ad_id']; $AdName_gal=$row3['Name']; $addtitle_gal=$row3['AddTitle']; $description_gal=$row3['AddtionalDt']; $location_gal=$row3['Location']; $image_gal=$row3['image_location']; $post_type_gal=$row3['post_type']; ?> <div class="gallery-listingpagePosts"> <div class="gallery-listingpagePostsLeft"> <img src="<?php echo $image_gal; ?>"> </div> <div class="gallery-listingpagePostsRight"> <div class="gallery-postsHeading"> <a href="view4.php?ad_id=<?php echo $ad_id; ?>"><?php echo $AdName_gal; ?></a> </div> <div class="gallery-postsDesc"><?php echo substr(strip_tags($row3['AddtionalDt']), 0, 100). "......"; ?></div><br/> </div><br/> </div> <br/> <?php } } else{ echo'<font color="red" size="5">No Post Found in this Category</font>'; } ?> </div> </td> </tr> <tr> <td> </td> </tr> </table> </td> </tr> </table> </div> <div id="footer"><table align="center" width="905" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="64px"><table width="905" border="0" cellspacing="0" cellpadding="0"> <tr> <td style="color:#cfcfcf;" height="64px" valign="middle"><a href="index.php" class="footlink">Home</a> | <a href="#" class="footlink">About Us</a> | <a href="highlighted.php" class="footlink">Highlighted Ads</a> | <a href="premium.php" class="footlink">Premium Ads</a> | <a href="gallery.php" class="footlink">Gallery Ads</a> | <a href="#" class="footlink">Contact Us</a></td> <td><table align="right" width="130" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right"><a href="#"><img src="images/facebook.png" alt="Facebook" border="0" /></a></td> <td align="right"><a href="#"><img src="images/twitter.png" alt="Twitter" border="0" /></td> <td align="right"><a href="#"><img src="images/linkedin.png" alt="Linkedin" border="0" /></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td><table width="905" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" style=" color:#828282; font-size:15px;" valign="middle" height="35px"><table width="905" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" style=" color:#828282; font-size:15px;" valign="middle">Copyright © 2013 TopAdsIndia. All rights reserved. </td> <td align="right"><a href="http://www.liveyourdreamsindia.com" target="_blank"><img src="images/designed.png" alt="Designedby: LiveYourDreamsIndia" border="0" /></a></td> </tr> </table></td> </tr> </table> </td> </tr> </table> </div> </div> </body> </html> In the above code, div id table2 has large no of records in my db. So, i have applied pagination to it. But i wanna apply same to other two div's. please help out.
  2. Dear all, Here is my scenario, I have a php page called index.php which is linked to dashboard. At the index page i will have 40-50 href's each with a id like dashboard.php/subcat=1 When a user click's particular href they will be forwarded to a page called dashboard and there i get this id. $subcat=$_REQUEST['subcat']; This dashboard is dynamic. In this page i have three different div's. Each with different query and result display. For example: My first div has a query and some 50 results. I want a display first four rows and remaining as a ajax pagination. similarly for the other two div's. There is no problem in using ajax pagination because it will be executed in different page and result will be display here. But the real problem is in each of my query i should pass the original subcat id which is what make the dashboard dynamic. Now, i need someway to pass this dynamic id for my external pagination for each query.
  3. I just executed the query into $query=mysql_query("query"); print_r($query); output is: Array ( [0] => 1 [product_id] => 1 [1] => 19103 [ponumbers] => 19103 [2] => 18410 [gonumbers] => 18410 ) how did u execute it?? am i doing wrong in executing. plz let me know!!
  4. Dear all, I am having the following problem and did not know the solution. I have three related tables. product purchase_order git_order. In product table product_id product_name 1 barrings 2 wheel rim 3 rodd purchase_order po_id product_id package_id numbers received etc. 1 1 2 100 50 2 2 4 250 60 3 1 1 200 40 4 1 3 200 40 5 2 5 200 40 6 1 1 200 40 7 1 5 200 40 git_order git_id product_id package_id numbers received etc. 1 1 2 100 50 2 2 4 250 60 3 1 1 200 40 4 1 3 200 40 5 2 5 200 40 6 2 1 200 40 7 1 5 200 40 The output i want is. product_id sum(numbers)in 2ndtable | sum(numbers)in 3rdtable 1 900 700 2 450 650 i need a query to do this. i m new to this. i spent lot of time in this but couldnt resolve. please help me. This is my present query: SELECT p.product_id, po.ponumbers, g.gonumbers FROM Product p LEFT JOIN (SELECT Product_id, SUM(numbers) AS ponumbers FROM purchase_order GROUP BY product_id ) AS po ON p.product_id = po.product_id LEFT JOIN (SELECT product_id, SUM(numbers) AS gonumbers FROM git_order GROUP BY product_id) AS g ON p.product_id = g.product_id this gives the following output: Array ( [0] => 1 [product_id] => 1 [1] => 19103 [ponumbers] => 19103 [2] => 18410 [gonumbers] => 18410 ) but i want not only for 1 product, i need the query to do the same for all the products that i have in my product table. any help??
  5. Dear members, I m running with the following problem for more than a week but i m not able to sort out. The scenario is that, in one of my php form i m having two dropdown and a text box related to each other. i.e when i select a product from dropdown1, the values of dropdown2 will be sorted based on the value of dropdown1 and similarly based on the value of dropdown2 , the value of textbox will be shown. This i accomplished with the help of ajax and jquery. And also this one working for me very well(shown in the image 1&2 of attachements). But the issue now is, in my product selection, my product list went very long so i had to bring an auto-suggestion. i brought the jquery selection with auto-complete model which has been shown in the same attachment(image3&4). the issue now is, when i select the product from my first dropdown, the second dropdown value is not loading, with firebug i checked, the values are properly retrieved for second dropdwn based on first drpdown but its not shwn up in the value list of second dropdwn. I don know what exactly the problem is. I m thinking it might be the clash of jquery versions that i m using. So, can some sort me out the problem with my form. I have included the form code here. <link rel="stylesheet" href="<?php echo HOME_URL; ?>chosen/chosen.css" /> <style type="text/css"> td { width:800px; } </style> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <script type="text/javascript" charset="utf-8"> $(function(){ $("select#product_id").change(function(){ var get_package_url = '<?php echo HOME_URL; ?>select.php'; $.getJSON(get_package_url,{product_id: $(this).val(), ajax: 'true'}, function(j){ var options = ''; options += '<option value="0"> -- Select -- </option>'; for (var i = 0; i < j.length; i++) { options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; } $("select#package_id").html(options); }) }) $("select#package_id").change(function(){ var get_package_url = '<?php echo HOME_URL; ?>select.php'; $.getJSON(get_package_url,{package_id: $(this).val(), ajax: 'true'}, function(j){ for (var i = 0; i < j.length; i++) { var value = j[i].optionDisplay; } $("#package_qty").val(value); }) }) }) </script> <script> $(function() { $( "#datepicker" ).datepicker({ altFormat: "dd-mm-yyyy" }); }); </script> <form action="<?php echo base_url(); ?>purchase_order/add" method="post"> <table border="1"> <tr> <td> <b>Product </b> <select name="product_id" style="width:250px;" data-placeholder="Choose a Supplier..." id="product_id" class="chzn-select"> <option value="0"> -- Select Product -- </option> <?php foreach($get_all_product as $value) { ?> <option value="<?php echo $value['product_id']; ?>"><?php echo $value['product_name']; ?></option> <?php }?> </select> </td> <td> <b>Order Qty </b> <input type="text" name="quantity" value="" style="width:75px;" /></td> <td> <b>Package</b> <select name="package_id" id="package_id"> </select> </td> <td> <b> Qty / Packing</b> <input type="text" name="package_qty" id="package_qty" value="" readonly="readonly" style="width:75px;" /></td> <td colspan="2"> <input type="submit" name="submit" value="Add to Cart" /> </td> </tr> </table> <script src="<?php echo HOME_URL; ?>chosen/chosen.jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(".chzn-select").chosen(); $(".chzn-select-deselect").chosen({allow_single_deselect:true}); </script> </form><br/><br/> <?php if($this->cart->contents()) { ?> <h2>Ordered Cart</h2> <br/> <table border="1"> <tr> <td> <b> Product </b> </td> <td> <b> Order Qty</b> </td> <td> <b>Qty/ Packing</b></td> <td> <b> MRP</b> </td> <td align="right"> <b>Amount </b></td> <td align="right"> <b>Action </b></td> </tr> <?php $grand_total = 0; foreach ($this->cart->contents() as $items) { ?> <tr> <td> <?php echo $items['name']; ?></td> <td> <?php echo $items['qty']; ?></td> <td> <?php echo $items['package_qty']; ?></td> <td> <?php echo $items['price'];//money_format('%!i',$items['price']); ?></td> <td align="right"> <?php echo $items['amount'];//money_format('%!i', $items['amount']); $grand_total = $items['amount']+$grand_total; $discount= $grand_total * 40/100; $gross_amount = $grand_total-$discount; ?></td> <td align="right"> Remove </td> </tr> <?php } ?> <tr> <td colspan="5" align="right"><b>Grand Total</b></td> <td align="right"><b><?php echo $grand_total;//money_format('%!i', $grand_total); ?></b></td> </table> <form method="post" action="<?php echo base_url()."purchase_order/create"; ?>"> <BR/> <BR/> Addtional Details : <textarea rows="5" cols="80" name="info"></textarea> <BR/> Date : <input type="text" name="date" value="<?php echo date('d-m-Y'); ?>" /><br/><br/><br/> <h2> Approximate value of Order</h2><br/> <b>Gross Amount:<b><?php echo $grand_total;?><br/> <b>Less Discount @ 40%:<b><?php echo $discount;?><br/> <b>Net Amount:<b><?php echo $gross_amount;?><br/> <input type="submit" name="submit" value="Create PO" /> </form> <?php } ?>
  6. Dear all, I am having a problem. I have a php form where i have triple drop down's connected. i.e I select the value from the 1st dropdown and based on that value 2nd dropdown's value will be loaded and similarly the 3rd one. It works fine as of now. But now suddenly i want to turn the 1st dropdown into a textbox with auto suggestion. I know how to bring auto suggestion in php. But the problem is that, inside the select i have used option value as the id to next select. i.e <select name="product_id" id="product_id"> <option value="0"> -- Select Product -- </option> <?php foreach($get_all_product as $value) { ?> <option value="<?php echo $value['product_id']; ?>"><?php echo $value['product_name']; ?></option> <?php }?> </select> So, i m not able to pass this id if i make the select into a textbox werent i m not allowed to have option value. So can anyone help me over come this issue. I knew ajax or jquery will help me in this. But dono how to proceed with. Any help is must appreciated. My original form code is: <style type="text/css"> td { width:800px; } </style> <script type="text/javascript" charset="utf-8"> $(function(){ $("select#product_id").change(function(){ var get_package_url = '<?php echo HOME_URL; ?>select.php'; $.getJSON(get_package_url,{product_id: $(this).val(), ajax: 'true'}, function(j){ var options = ''; options += '<option value="0"> -- Select -- </option>'; for (var i = 0; i < j.length; i++) { options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; } $("select#package_id").html(options); }) }) $("select#package_id").change(function(){ var get_package_url = '<?php echo HOME_URL; ?>select.php'; $.getJSON(get_package_url,{package_id: $(this).val(), ajax: 'true'}, function(j){ for (var i = 0; i < j.length; i++) { var value = j[i].optionDisplay; } $("#package_qty").val(value); }) }) }) </script> <script> $(function() { $( "#datepicker" ).datepicker({ altFormat: "dd-mm-yyyy" }); }); </script> <form action="<?php echo base_url(); ?>purchase_order/add" method="post"> <table border="1"> <tr> <td> <b>Product </b> <select name="product_id" id="product_id"> <option value="0"> -- Select Product -- </option> <?php foreach($get_all_product as $value) { ?> <option value="<?php echo $value['product_id']; ?>"><?php echo $value['product_name']; ?></option> <?php }?> </select> </td> <td> <b>Order Qty </b> <input type="text" name="quantity" value="" style="width:75px;" /></td> <td> <b>Package</b> <select name="package_id" id="package_id"> </select> </td> <td> <b> Qty / Packing</b> <input type="text" name="package_qty" id="package_qty" value="" readonly="readonly" style="width:75px;" /></td> <td colspan="2"> <input type="submit" name="submit" value="Add to Cart" /> </td> </tr> </table> </form><br/><br/> <?php if($this->cart->contents()) { ?> <h2>Ordered Cart</h2> <br/> <table border="1"> <tr> <td> <b> Product Name </b> </td> <td> <b> Price</b> </td> <td> <b> Package Qty</b> </td> <td> <b>No of Qty </b></td> <td align="right"> <b>Amount </b></td> <td align="right"> <b>Action </b></td> </tr> <?php $grand_total = 0; foreach ($this->cart->contents() as $items) { ?> <tr> <td> <?php echo $items['name']; ?></td> <td> <?php echo $items['price'];//money_format('%!i',$items['price']); ?></td> <td> <?php echo $items['package_qty']; ?></td> <td> <?php echo $items['qty']; ?></td> <td align="right"> <?php echo $items['amount'];//money_format('%!i', $items['amount']); $grand_total = $items['amount']+$grand_total; $discount= $grand_total * 40/100; $gross_amount = $grand_total-$discount; ?></td> <td align="right"> Remove </td> </tr> <?php } ?> <tr> <td colspan="5" align="right"><b>Grand Total</b></td> <td align="right"><b><?php echo $grand_total;//money_format('%!i', $grand_total); ?></b></td> </table> <form method="post" action="<?php echo base_url()."purchase_order/create"; ?>"> Addtional Details : <textarea rows="5" cols="100" name="info"></textarea> Date : <input type="text" name="date" value="<?php echo date('d-m-Y'); ?>" /><br/><br/><br/><br/> <h2> Approximate value of Order</h2><br/> <b>Gross Amount:<b><?php echo $grand_total;?><br/> <b>Less Discount @ 40%:<b><?php echo $discount;?><br/> <b>Net Amount:<b><?php echo $gross_amount;?><br/> <input type="submit" name="submit" value="Create PO" /> </form> <?php } ?> Thanks in advance..!!
  7. Dear all, My new web project is fully based on javascript. Each and every fields and form's have javascrip and ajax call's. So, if any user who comes without any knowledge of javascrip whether it is enabled or disabled in browser, my site will not work properly for them. So, i want to prevent them from unknowingly feel that the site has problem. Instead i just want to throw an error like google or any site does. If an access to my page comes from a browser i should first check whether the javascript functionality has been enables or not. If not i will throw an error saying that "please enable javascript in your browser for the better user interface something like that. How can i acheive this. I am having this in mind but do not know how to acheive the output. Any help will be greatful. Thanks!
  8. Hi requinix, Thanks for the reply. But i want to know the way i can apply the method into my textarea. Since i m not that expert, i want your help in that. Just show me the javascript function which can be called to test it.. Thanks!
  9. Hi there, I am having the following ad posting page. But i m really confused of applying a input validation. I just want to display error when there is any field which left unfilled. Error should be displayed near the field. In case of email i want to show whether the email is already available in the database or not. if available i will show available. if not available then i will show the same. All the validations should happen when i click submit button. If everything is filled, then the submit button should take me to next page. Can anyone help me with this. I m terrible in search for it. my code: <?php include("conndb.php"); function createoptions($table , $id , $field) { $sql = "select * from $table ORDER BY $field"; $res = mysql_query($sql) or die(mysql_error()); while ($a = mysql_fetch_assoc($res)) echo "<option value=\"{$a[$id]}\">$a[$field]</option>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Post a Free Ad</title> <link href="loginmodule.css" rel="stylesheet" type="text/css" /> <style> #entrydt1 { margin-left: 100px; } #orderid1 { margin-left: 107px; } #orderdt1 { margin-left: 94px; } #itemid { margin-left: 142px; } #qtyid { margin-left: 122px; } #packid { margin-left: 120px; } #qtynoid { margin-left: 80px; } #Poid { margin-left: 80px; } #resetid { margin-left: 80px; } #clearid { margin-left: 80px; } #Name { margin-left: 50px; width: 100px; } </style> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" charset="utf-8"> $(function(){ $("select#MRP").change(function(){ var qty = $('#subcat2').val(); var MRP = $('#MRP').val(); var t7 = $('#t7').val(); var total = (qty * (MRP*(t7/100))); $("#amount").val(total); }) }) $(function(){ $("select#category").change(function(){ $.getJSON("select.php",{category: $(this).val(), ajax: 'true'}, function(j){ var options = ''; for (var i = 0; i < j.length; i++) { options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; } $("select#subcategory").html(options); }) }) $("select#subcategory").change(function(){ $.getJSON("select.php",{subcategory: $(this).val(), ajax: 'true'}, function(j){ var options = ''; for (var i = 0; i < j.length; i++) { options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; //options = '<input type="text" id="subcat2" name="subcat2" value="' + j[i].optionDisplay + '" />'; } /*$("select#subcategory2").html(options);*/ }) }) }) $(function(){ $("select#category").change(function(){ $.getJSON("select.php",{category: $(this).val(), ajax: 'true'}, function(j){ var options = ''; for (var i = 0; i < j.length; i++) { options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; } $("select#subcategory").html(options); }) }) $("select#subcategory").change(function(){ $.getJSON("select.php",{subcategory: $(this).val(), ajax: 'true'}, function(j){ var options = ''; for (var i = 0; i < j.length; i++) { options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; //options = '<input type="text" id="subcat2" name="subcat2" value="' + j[i].optionDisplay + '" />'; } ("select#subcategory2").html(options); }) }) }) </script> </script> </head> <body> <h1>Post a Free Ad</h1> <form method="post" name="form" action="preview.php"> <table border='0'> <tr> <td><label for="name">Enter the name of the product or service you want</label></td> <td> <input type="text" name="ad" size=20 value=""/></td> </tr> <tr> <td> Select your Category</td> <td><select name="cat" id="category" style="width:11em;"> <option value="-1">--Select--</option> <?php createoptions("category", "cat_id", "category"); ?> </select> </td> </tr> <tr> <td> Select Subcategory </td> <td><select name="subcat" id="subcategory" style="width:11em;"> </select> </td> </tr> <tr> <td>Ad Type </td> <td><input type="radio" name="adtype" value="I Am Offering">I Am Offering <input type="radio" name="adtype" value="I Am Looking For">I Am Looking For </td> </tr> <tr> <td>Ad Title <font color="red">*</font></td> <td><input type="text" name="title" value="" style="width:15em;"></td> </tr> <tr> <td>Location<font color="red">*</font></td> <td><input type="text" name="location" value="" style="width:15em;"></td> </tr> <tr> <td>Addtional Details</td> <td><textarea name="info" rows="5" cols="50"></textarea></td> </tr> <tr> <td> <font face="arial" color="green" size="5"/> Verification Details here!! </td> </tr> <tr> <td>Email </td> <td><input type="text" name="email" value="" style="width:15em;" / > </td> </tr> <tr> <td>Mobile </td> <td><input type="text" name="mobile" value="" style="width:15em;" / > </td> </tr> <td> <input type="submit" name="submit" value="Preview Ur Ad"/></td> </tr> </table> <br /> <br /> </form> </body> </html>
  10. Dear all, I have having a text area field which has a limit of 100 characters only. Now, i also want to validate it such that it should only contain letter's (alphabet A-Z .a-z). It should not contain any number or @ symbol. If such things entered it should throw me an error saying invalid arguments like that. I know it can be done with regular expressions. But i m not aware of how to do. Can some one help with that. Here is my script. <script language="javascript" type="text/javascript"> function limitText(limitField, limitCount, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.value = limitNum - limitField.value.length; } } </script> <tr> <td valign="top" align="left">Description</td> <td valign="top">:</td> <td align="left"><textarea name="limitedtextarea" onkeydown="limitText(this.form.limitedtextarea,this.form.countdown,100);" onkeyup="limitText(this.form.limitedtextarea,this.form.countdown,100);"> </textarea><br> <font size="1">(Maximum characters: 100)<br> You have <input readonly type="text" name="countdown" size="3" value="100"> characters left.</font></td> </tr>
  11. Dear all, I have having a text area field which has a limit of 100 characters only. Now, i also want to validate it such that it should only contain letter's (alphabet A-Z .a-z). It should not contain any number or @ symbol. If such things entered it should throw me an error saying invalid arguments like that. I know it can be done with regular expressions. But i m not aware of how to do. Can some one help with that. Here is my script. <script language="javascript" type="text/javascript"> function limitText(limitField, limitCount, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.value = limitNum - limitField.value.length; } } </script> <tr> <td valign="top" align="left">Description</td> <td valign="top">:</td> <td align="left"><textarea name="limitedtextarea" onkeydown="limitText(this.form.limitedtextarea,this.form.countdown,100);" onkeyup="limitText(this.form.limitedtextarea,this.form.countdown,100);"> </textarea><br> <font size="1">(Maximum characters: 100)<br> You have <input readonly type="text" name="countdown" size="3" value="100"> characters left.</font></td> </tr>
  12. Hi all, I have attached a php script that contains the state and cities in each state in a array. I want to store them into mysql in such a way i bring them into my ajax based multi drop down. Please help me on storing this as i need have them into mysql. By doing manual storage it takes lot of time. I knew it is possible to send this array to mysql. but not sure how to do that. please need help in this.! Thanks! statecity.php
  13. Dear All, I have a scenario where i want to display database field's with values after selecting the id from combo. For eg: I am having a stock table with stcid as primary key. I have other fields in stock table such as itemname, qty,package,rate,disc,amount etc. What i m looking to do is, In a php form, i want to have a combo alone initially that has to be loaded with available stcid's from db. Based on the id that is selected i want to load the fields dynamically with values from db for that particular id. The point is, i want to show the table field with label and boxes only after i select the id. which means initially my php page will have only the combo box. How can i do this.. Any examples or methods to achieve this?? Thanks!
  14. Dear all, I m presently having a php page in which i have table contains data from sql for an item. And i m looking to have a button for a field of item, which when i click it should open an ajax window with details from another sql table. Basically the idea is i have a purchase order form i.e in my present window in php in which i will have a field i.e Against PO pending. the value for that field will basically the calculated value from another sql table. When i clikc a button in PO pending it should load me the Po Pending table details in ajax pop up were i m able to pick the Pending po value.. How could i accomplish that.. I m not having any background in Ajax. Can anyone give me an example similar to my need.. So, that i can use as base reference.!! Thanks!
  15. Hi 50r, Yes, presently i have a table with one row in which i fill the five fields and when i click add item i store them into database. What i look for is, whenever i insert an item i want to display it in the same page below my present table. No mater how many items i insert, all should be displayed and i should be able to scroll and see them..!
×
×
  • 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.