Jump to content

Search the Community

Showing results for tags 'jquery'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Hi all, I need a PHP genious to be my business partner in exchange of 40% of my business. About Me I am a graphic/web designer and SEO guru. I work full time in a UK design firm. For two years I did all the SEO or one of the UK's biggest mobile phone networks. I am a very competent SEO and have great knowlege of branding and online marketing. I spend at least one day a week (usually Sunday) building my online business. About My Business I currently operate just one online venture: www.comparisim.com which is the backbone of my company so far. The site has only launched properly about 2 months ago and since generated about ÂŁ150 in comission last month alone and has got over 2000 visitors. The site has the potential to generate a lot more traffic and convert a higher percentage of its traffic into commision. Before the site launched I designed, branded, SEOed and paid for the sites development. i have invested about 1.5K getting to this stage + more hours than I can count. Why I Need You? the problem with comparisim.com is it relies on data feeds for the deals to update. There are currently 6 data feeds in use - one for each provider. When providers change the format of the feeds the deals dont update which prevents users from making transactions. Currently I have to wait weeks or even months for my developer to get around to it. This is not good for business and it damages the comparisim brand. Every now and then other programming issues crop up like i find bugs, browser updates break things, I need a new provider added etc. Other times I come up with tweaks and modifications. For example I hope to get a mobile site soon. So for all these things I need some one who knows what their doing and who can respond quickly. By having some who deals with fixing feeds and other programming issues quickly and independantly of my input, i will be free to do SEO link building, improve the content What I Need From You: quick response time for broken feeds (24-48 hours) You should have dedication and drive. someone who can share my vision for making the UKs best SIM only comparison site and is willing to go the extra mile to improve the site. I need a developer who can show attention to detail and look for problems and find solutions. You need to be a nice person Ability to communitcate clearly and openly (in English) via email. You should take the inititive to check the feeds on a weekly basis or write a script to do that for you and respond to issues with a effective solution. I need you to be honest, trustworthy and fair Most of all I need you to be in it to win it and not give up untill we have success. If you're interested please contact me on fionmccormack[a]gmail.com or post a comment below if you have any questions
  2. I have a navigation script and I want to load the contents using ajax. the navigation script calls the ajax function but I don't know how to pass the ajax function the a href="data to be loaded" part. to test the script I have 2.php in the ajax function so how can I make '2.php' a variable that will change with the click of the link ? thank you <ul id="navigation"> <li class="one"><a href="index.html">home</a></li> <li class="two"><a href="2.php">page 2</a></li> <li class="three"><a href="3.php">page 3</a></li> <li class="four"><a href="4.php">page 4</a></li> <li class="five"><a href="5.php">page 5</a></li> <li class="shadow"></li> </ul> <div id="content"> <h2>here comes the content from the requested page</h2> </div> </div> <script type="text/javascript"> $(document).ready(function(){ $("ul#navigation li a").click(function() { $("ul#navigation li").removeClass("selected"); $(this).parents().addClass("selected"); return false; }); }); $("ul#navigation li a").click(function(){ $("#content").load("2.php",function(responseTxt,statusTxt,xhr){ if(statusTxt=="success") alert("External content loaded successfully!"); if(statusTxt=="error") alert("Error: "+xhr.status+": "+xhr.statusText); }); }); </script>
  3. Hello, I am currently developing a site but I have ran into a problem. The Google Maps is not rendering correctly and a grey area is visible. I have tried to use the resize facility initiated on window.onload and I have provided inline styling but to no avail. Any suggestion will be greatly appreciated. The Page with map implement can be found at http://www.esfdev.co.uk/bede/contact-us-and-lettings/find-us/ .Again and help will be greatly appreciated.
  4. Code: jQuery code $(document).ready(function(){ setInterval(checkChat, 3000); }); function new_message(){ var val = $(".chat_box").attr('id'); var id_reciver = val.substr(val.indexOf("_") + 1) $(".chat_box").bind('keydown', function(e){ alert(e.keyCode); e.preventDefault(); }); } html code <textarea class='chat_box' id='input_"+chatuser+"' placeholder='type message' onkeyup='new_message()'></textarea> Problem description (time line of problem): 1) The first time when i press any key on the keyboard, i do not have alert(e.keyCode) 2) The second time when i press any key on the keyboard, i have correct alert(e.keyCode) 3) The third time when I press the button on the keyboard, i have correct alert(e.keyCode), but 2 time alert`s 4) ..... i have correct alert(e.keyCode), but 3 time alert`s 5) ... and so on .... Why this happens? Alert instead, there should be standing at the mysql_query("insert into.... posts for inserting message in database, but, this code will be insert message "N" times in row... and that is not ok. PS: You can see the message box on attached picture (i have 2 same message in row) (i try to upgrade chat box application, and i m try to be like chat on Facebook, everything that I had planned I've done, I've just not about sending this message -... i send messages, but the few times one and the same :S)
  5. Hi all, I have this form that has a label with a click event mapped to toggle the visibility of a textarea and it worked great until I setup 2 combo boxes with an ajax call for the second. After opening the form the toggle on #notes_sh works ok. If I set values in the 2 combo boxes and then try to select the #notes_sh label there is no event fired. I have no errors coming up in my js console. Any ideas why this toggle it not firing after setting values in the combo boxes? James ps. Occurs on both Chrome and Firefox. $("#notes_sh").click(function(){ // Notes show and hide toggle, off by default, $("#fld_notes").toggle(); $('#category_id').change( function() { checkCategory(); // checks value and enables/disables subcategory control var catid = $(this).val(); var dataString = 'catid='+catid; $.ajax ({ type: "POST", url: "catalogues.php", data: dataString, cache: false, success: function(data) { $('#subcategory_id').html(data).focus(); } }); }); // Get subcategory_id records for select box if(isset($_POST['catid'] )) { $catid=$_POST['catid']; $sql_subcategory = "SELECT catalogues_categories.id, catalogues_categories.category, catalogues_categories.parent_id, catalogues_categories.inuse FROM catalogues_categories WHERE catalogues_categories.parent_id = '$catid' AND catalogues_categories.inuse = 1 ORDER BY catalogues_categories.category ASC"; $query_subcategory = $conn->query($sql_subcategory); $results_subcategory = $query_subcategory->fetchAll(); echo '<option value= "-1"> Please Select </option>'; foreach ( $results_subcategory as $row ){ echo '<option value="'.$row['id'].'">'.$row['category'].'</option>'; } $conn = null; // Play it safe and close the connection $_POST['catid'] = null; // Reset post category id as we dont need it any more. } else { $results_subcategory = null; }
  6. Hey guys I've got the slider I want. All I need to do now is understand this jquery code and remove the transition property. So that the slider doesn't slide automatically. If you guys can go to this URL and view page source you'll be able to see all the code that makes up this page http://nurdit.com/jsresponsive/slider.html Any help please please please would be much appreciated
  7. Hi all, I would like to create a function that allows two options to be selected and then on pressing submit it loads in content dynamically. How can I create such a feature ? Any help would be much appreciated
  8. Hi all, I really need some help on this one. I've created a very complex page with a number of buttons that load content in dynamically. (There are quite a few combinations) What I would like to know is, is there a way to hard-code if an option is selected on one page that that selection stay open on another page ? For example I'm on the globe.html page having selected option 3. I open the view.html page and that page starts on option 3 due to it being selected on the previous page. Any help would be very appreciated
  9. Hello, I'm trying to retrieve dates from the database based on a selection. If a user selects singer A for example, then I'm going through the database and get the unavailable dates of singer A. var unavailableDates; function unavailable(date) { dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear(); if ($.inArray(dmy, unavailableDates) == -1) { return [true, ""]; } else { return [false, "", "Unavailable"]; } } $(document).ready(function() { $("#datepicker").datepicker({ dateFormat: 'yy-mm-dd', beforeShowDay: unavailable, minDate: 0, firstDay: 1, // rows starts on Monday changeMonth: true, changeYear: true, showOtherMonths: true, selectOtherMonths: true, altField: '#date_due', altFormat: 'yy-mm-dd' }); $('#datepicker').focus(function(){ //alert($('#name').html()); $.ajax({ url: 'getDates.php', data: "artist_id="+$('#name').html(), dataType: 'json', success: function(data) { alert(data) } }); }) }); Everything works fine. Using the "getDates.php" I retrieved the dates and pass them through the function. But how can I pass the data (after success: function) to the unavailable dates above? I have the dates from database but I don't know how to link them with the array "unavailableDates" (line 1) in order to show unavailable dates in datePicker.
  10. Hello all, Im working on a back-end system that sends push notifications. At the moment on click of send button the loading gif appears underneath. I would like the send button to disappear and for the loading gif to appear as it is now. How can I implement this feature ? Any help would be much appreciated <div class="row-fluid"> <input type="submit" name="badgeSubmit" class="span5 offset7 blue-button" value="Send" onClick='return checkvalue() && toggle(); return false;' /> <img style="position:relative; top:20px;"src="/images/sending.gif" alt="loading" class="sending"> </div>
  11. Hi. I'm trying to display a list of items i have in my database. It displayed correctly as how i wanted it to. However, there is a button which popup a jQuery div tag. It pop up correctly, just that it only show the 1st content in my database table. I believe it is the jQuery ID that is confused but I just don't know how to define the ID separately in jQuery. Below is my code: HTML: //My Button <a href="#" id="map_link" class="topopup-map"> <div class="self-drive-view-map-button"> <img src="images/content/map-icon.png" height="23px"> </div> </a> //My Pop-Up Div <div id="toPopup-map"> <div id="popup_content_map"> <?php echo $map; ?> </div> </div> jQuery: jQuery(function($) { $("a.topopup-map").click(function() { loading(); setTimeout(function(){ loadPopup(); }, 500); return false; }); /* event for close the popup */ $("div.close").hover( function() { $('span.ecs_tooltip').show(); }, function () { $('span.ecs_tooltip').hide(); } ); $("div.close").click(function() { disablePopup(); }); $(this).keyup(function(event) { if (event.which == 27) { disablePopup(); } }); $("div#backgroundPopup").click(function() { disablePopup(); }); $('a.livebox').click(function() { alert('Hello World!'); return false; }); /************** start: functions. **************/ function loading() { $("div.loader").show(); } function closeloading() { $("div.loader").fadeOut('normal'); } var popupStatus = 0; function loadPopup() { if(popupStatus == 0) { closeloading(); iframe_code = $('#toPopup-map').html(); $('#toPopup-map').html(iframe_code).fadeIn(500); $("#backgroundPopup").css("opacity", "0.7"); $("#backgroundPopup").fadeIn(0001); popupStatus = 1; } } function disablePopup() { if(popupStatus == 1) { $('#toPopup-map').html(iframe_code).fadeOut(500); $("#backgroundPopup").fadeOut("normal"); popupStatus = 0; } } /************** end: functions. **************/ }); // jQuery End Any solution?
  12. <?php /* Template Name: Warranty New */ //Include the database class require("report/db.class1.php"); ?> <script type="text/javascript" src="/addjs/jquery_003.js"></script> <script type="text/javascript" src="/addjs/chainedselects.js"></script> <script type="text/javascript" src="/addjs/contentwarranty.js"></script> <link rel="stylesheet" href="/Reports/warranty.css" type="text/css" media="screen" /> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> <script type='text/javascript' src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <script src="/Reports/jquery.validate.js"></script> <script src="http://jquery.bassistance.de/validate/additional-methods.js"></script> <script type="text/javascript"> $(function() { var scntDiv = $('#p_scents'); var i = $('#p_scents div').size() + 1; $('#addScnt').on('click', function() { if ($('input#wproserial[]'+(i-1)).val() != '') { $('<table class="multiple-rows" ><tr class="prod-row prod-row"><td><input type="text" name="wwarrantycard[]'+i+'" id="wwarrantycard'+i+'" class="textinput2 required" autocomplete="off" value=""/></td><td><select class="selectbox " id="maker'+i+'" name="makes[]'+i+'"></select></td><td><select name="types[]'+i+'" id="typer'+i+'" class="selectbox "></select></td><td><select name="models[]'+i+'" id="modelr'+i+'" class="selectbox " ></select></td><td><input name="wproserial[]'+i+'" id="wproserial'+i+'" type="text" value="" class="textinput3"></td><td width="20px" style="text-align:center"><a href="javascript:void(0);" id="remScnt'+i+'" class="remScnt">X</a></td></tr></table>').appendTo(scntDiv); } else { alert('Enter your product first!'); $('input#wproserial[]'+(i-1)).focus(); } var1="maker"+i; var1_1=document.getElementById(var1); var2="typer"+i; var2_1=document.getElementById(var2); var3="modelr"+i; var3_1=document.getElementById(var3); initListGroup('vehicles', var1_1, var2_1, var3_1, 'cs'); document.getElementById(var1).selectedIndex=""; document.getElementById(var2).selectedIndex="" document.getElementById(var3).selectedIndex="" i++; return false; }); $('#p_scents').on('click', '.remScnt', function() { if (i > 1) { $(this).parents('table').remove(); i--; } return false; }); }); </script> <script type="text/javascript"> $(function() { $( "#wdatepurchase" ).datepicker({ dateFormat: 'dd-mm-yy', }); $( "#wdob" ).datepicker({ dateFormat: 'dd-mm-yy', changeMonth: true, changeYear: true, yearRange: "1950:2003", onSelect: function() { $( "#datepicker" ).trigger('blur'); } }); }); $(document).ready(function() { $.validator.addMethod("dateRule", function(value, element) { return value.match(/^(0[1-9]|[12][0-9]|3[01])[- //.](0[1-9]|1[012])[- //.](19|20)\d\d$/); }, "Please enter a date in the format dd/mm/yyyy" ); $('form.warregform').on('submit', function(event) { // adding rules for inputs with class 'first' $('#wfirstname').each(function() { $(this).rules("add", { required: true, minlength: 3, messages: { required: "Type your first name!", minlength: jQuery.format("Please, at least {0} character are necessary!") } }) }); // adding rules for inputs with class 'last' $('#wlastname').each(function() { $(this).rules("add", { required: true, minlength: 3, messages: { required: "Type your last name!", minlength: jQuery.format("Please, at least {0} character are necessary!") } }) }); // adding rules for inputs with class 'last' $('#wyourphone').each(function() { $(this).rules("add", { required: true, number: true, minlength: 9, messages: { required: "Type you contact number! (eg. 015679322)!", minlength: jQuery.format("Please, at least {0} number are necessary!") } }) }); // adding rules for inputs with class 'last' $('#wdatepurchase').each(function() { $(this).rules("add", { required: true, minlength: 10, dateRule: true, messages: { required: "Insert your Purchase Date (dd-mm-yyyy)!", date: "Please enter a valid date.", minlength: jQuery.format("Please, at least {0} are necessary!") } }) }); // adding rules for inputs with class 'comment' $('input.textinput2').each(function() { $(this).rules("add", { required: true, number: true, minlength: 3, messages: { required: "Type warranty cards number!", minlength: jQuery.format("Please, at least {0} number are necessary") } }) }); // adding rules for inputs with class 'comment' $('select.selectbox').each(function() { $(this).rules("add", { required: true, messages: { required: "", } }) }); // adding rules for inputs with class 'comment' $('input.textinput3').each(function() { $(this).rules("add", { required: true, minlength: 3, remote: "report/user_check.php", messages: { required: "Type Serial number!", minlength: jQuery.format("Please, at least {0} character are necessary"), remote: jQuery.format("{0} is already taken"), // remote: 'This email address has already been used' } }) }); // adding rules for inputs with class 'last' $('#wshoplocation').each(function() { $(this).rules("add", { required: true, messages: { required: "Choose Shop Location!", } }) }); // test if form is valid if($('form.warregform').validate().form()) { console.log("validates"); } else { console.log("does not validate"); } }) // initialize the validator $('form.warregform').validate(); }); </script> <?php $hasErrors = false; //If form was submitted if (isset($_POST['btnSubmit'])) { for ( $i=0;$i<count($_POST['wwarrantycard']);$i++) { { $wwarrantycard = $_POST['wwarrantycard'][$i]; $makes = $_POST['makes'][$i]; $types = $_POST['types'][$i]; $models = $_POST['models'][$i]; $wproserial = $_POST['wproserial'][$i]; } } if(empty($_POST['wfirstname'])){ $nameErr = "With more than 3 letters!"; $hasErrors = true; }if(empty($_POST['wlastname'])){ $nameErr = "With more than 3 letters!"; $hasErrors = true; }else if (empty($_POST['wyourphone'])){ $phoneErr = "With more than 7 Numeric! (eg. 015679322)"; $hasErrors = true; }else if(strlen($_POST['wyourphone']) <= 7){ $phoneEErr = "With more than 7 Numeric! (eg. 015679322)"; $hasErrors = true; }else if (empty($wwarrantycard)){ $wcardErr = "Missing insert product after you click add more product. Please insert and try again!!!"; $hasErrors = true; }else if (empty($makes)){ $wcardErr = "Missing insert product after you click add more product. Please insert and try again!!!"; $hasErrors = true; }else if (empty($types)){ $wcardErr = "Missing insert product after you click add more product. Please insert and try again!!!"; $hasErrors = true; }else if (empty($wproserial)){ $wcardErr = "Missing insert product after you click add more product. Please insert and try again!!!"; $hasErrors = true; }else if (empty($_POST['wshoplocation'])){ $shopErr = "Please Select Shop Location."; $hasErrors = true; } else{ } } ?> <?php if (!isset($_POST['btnSubmit']) || $hasErrors) { ?> <body onLoad="initListGroup('vehicles', document.warrantyform.maker, document.warrantyform.typer, document.warrantyform.modelr, 'cs'); resetListGroup('vehicles');" > <div class="divider"></div> <div class="clear"></div> <form name="warrantyform" id="warrantyform" class="warregform" enctype="multipart/form-data" autocomplete="OFF" method="post"> <div class="warrleft"> <label class="labeln"><strong>First Name: * </strong> <span id="nameInfo"></span></label> <label for="wfirstname" class="error"></label> <input class="textinput " type="text" name="wfirstname" id="wfirstname" size="30" maxlength="60" value="" autocomplete="off"/> </div> <div class="warrleft"> <label class="labeln"><strong>Last Name: * </strong> <span id="nameInfo"></span></label> <label for="wlastname" class="error"></label> <input class="textinput " type="text" name="wlastname" id="wlastname" size="30" maxlength="60" value="" autocomplete="off"/> </div> <div class="clear"></div> <div class="warrleft"> <label class="labeln"><strong>Your Email: </strong> <span id="emailInfo">NOTE: Warranty confirmation will be sent to your email address</span></label> <input class="textinput " type="text" name="wyouremail" id="wyouremail" size="30" maxlength="60" value="" autocomplete="off"/> </div> <div class="warrleft"> <label class="labeln"><strong>Contact Number: * </strong> <span id="wcontactInfo"></span></label> <label for="wyourphone" class="error"></label> <input class="textinput " type="text" name="wyourphone" id="wyourphone" size="30" maxlength="60" value="" autocomplete="off"/> </div> <div class="clear"></div> <div class="warrleft"> <label class="labeln"><strong>Gender: </strong></label><br/> <select name="wgender" id="wgender" > <option value="Male">Male</option> <option value="Female">Female</option> </select> </div> <div class="warrleft"> <label class="labeln"><strong>Date Of Birth: </strong></label><br/> <input class="textinput " type="text" name="wdob" id="wdob" size="30" maxlength="60" value="" autocomplete="off" readonly/> </div> <div class="clear"></div> <div class="warrleft"> <label class="labeln"><strong>Company Name: </strong></label><br/> <input type="text" maxlength="100" value="" name="wcompanyname" id="wcompanyname" class="textinput" autocomplete="off"> </div> <div class="warrleft"> <label class="labeln"><strong>Job Title: </strong></label><br/> <input type="text" maxlength="100" value="" name="wjobtitle" id="wjobtitle" class="textinput" autocomplete="off"> </div> <?php $todays_date = date("d-m-Y"); ?> <div class="warrleft"> <label class="labeln"><strong>Date of Purchase: * </strong></label> <label for="wdatepurchase" class="error"></label> <input type="text" maxlength="100" value="<?php echo $todays_date; ?>" name="wdatepurchase" id="wdatepurchase" class="textinput" autocomplete="off"> </div> <div class="clear"></div> <span id="wcardInfo"></span> <table class="multiple-rows" > <tr class="prod-row2"> <td><label><strong>Warranty Card No: *</strong> </label></td> <td><label><strong>Product Category *</strong></label></td> <td><label><strong>Sub Category *</strong></label></td> <td><label><strong>Model Name *</strong></label></td> <td><label><strong>Serial Number *</strong></label></td> <td width="20px"> </td> </tr> <tr class="prod-row prod-row"> <td><input type="text" name="wwarrantycard[]" id="wwarrantycard0" value="" class="textinput2 " autocomplete="off"/></td> <td><select name="makes[]" id="maker" class="selectbox "></select></td> <td><select name="types[]" id="typer" class="selectbox "></select></td> <td><select name="models[]" id="modelr" class="selectbox "></select></td> <td><input name="wproserial[]" id="wproserial0" type="text" value="" class="textinput3 " autocomplete="off"></td> <td> </td> </tr> </table> <div id="p_scents"></div> <div class="addproducts"><a href="javascript:void(0);" id="addScnt">Add another product</a></div> <div class="clear"></div> <div class="warrleft"> <label class="labeln"><strong>Shop Location: * </strong><span id="wshopInfo"></span></label> <label for="wshoplocation" class="error"></label> <select name="wshoplocation" id="wshoplocation" > <option value="">Select Shop</option> <option value="I-Qlick">I-Qlick</option> <option value="CS_KTH">CS_KTH</option> <option value="CS_Ahhoo">CS_Ahhoo</option> <option value="CS_Sunsimexco">CS_Sunsimexco</option> <option value="Other">Other</option> </select> </div> <div class="warrleft"> <label class="labeln"><strong>Rate Shop Service:</strong></label> <select class="" name="wrate" id="wrate"> <option value="Very Good">Very Good</option> <option value="Good">Good</option> <option value="Normal">Normal</option> <option value="Bad">Bad</option> </select> </div> <div class="clear"></div> <div class="warrleft"> <input type="checkbox" name="wpromo" id="wpromo" value="Yes" /> <strong>I want to receive i-Qlick's promotions by email.</strong></p> </div> <div class="clear"></div> <div class="warrleft"> <input id="go" name="btnSubmit" type="submit" value="Submit" class="btn"/> <!--<input id="go" name="btnSubmit" type="submit" value="Submit" class="btn" onClick="targetGroup('textinput2');"/>--> <input type="reset" value="Reset" onClick="resetListGroup('vehicles')" > </div> </form> <!--<script type="text/javascript" src="<php bloginfo( 'url' ); ?>/Reports/validation.js"></script>--> <?php } ?> above is My Html Files... I can't check validation with existing database, this serial no. is already register or not. every input data is showing message "is already taken". so i can't submit. My Serial no input field is unlimited. user_check.php <?php include("db.class1.php"); if (isset($_POST['wproserial'])) { //create instance of database class $db = new mysqldb(); $db->select_db(); for ( $i=0;$i<count($_POST['wproserial']);$i++) { { $wproserial = $_POST['wproserial'][$i]; } } //$query = "SELECT * FROM products WHERE SerailNo"; //$query = "SELECT * FROM products WHERE SerailNo='".$wproserial."'"; //$query = "SELECT * FROM products WHERE SerailNo='$wproserial'"; $query = "SELECT * FROM `products` WHERE `SerailNo` = '".mysql_real_escape_string($wproserial)."'"; //$query = "SELECT EXISTS (SELECT * FROM products WHERE SerailNo='".mysql_real_escape_string($wproserial)."')"; if($db->num_rows($db->query($query)) < 1) { /*return true; }else { return false; } */ $valid = 'true'; }else { $valid = 'false'; } echo json_encode($valid); } ?>
  13. I have a div I use for dialogs and I want to pass a string to the div and then show the specific twig template as an include. The div dialog is displayed without the template embedded, What am I doing wrong, is there a better way to do it? $('#new').click( function() { var str = " {% include 'catalogue_form.html' %} "; $('#dialog').text(str).html(); showDialog(); }); function showDialog() { $('#dialog_wrapper').fadeIn(); $('#dialog').fadeIn("slow"); } Thanks in advance, James
  14. i have 2 input forms, the "Date From" and "Date To" , both are using jquery's date picker My question is, how to limit the user to select only a range of one month using those two datepickers ? this is the snippet of the "Date From" date picker $this->widget('zii.widgets.jui.CJuiDatePicker', array( 'model' => $model, 'attribute' => 'STARTDATE', 'options' => array( 'dateFormat'=>'yy-mm-dd', 'showOn'=> 'both', 'buttonImage'=> Yii::app()->theme->baseUrl."/images/calendar.gif", 'buttonImageOnly' => 'true', 'dateFormat'=>'dd-mm-yy', 'changeMonth' => 'true', 'changeYear' => 'true', 'showButtonPanel' => 'true', 'constrainInput' => 'false', 'duration'=>'fast', 'showAnim' =>'slide', 'ampm' => 'true', 'onSelect' => 'js:function(selectedDate) {$( "#paymenttrans_TRANSDATETO" ).datepicker( "option", "minDate", selectedDate );}' ), 'flat'=>false, 'htmlOptions'=>array( 'readonly'=>'TRUE', 'size'=>'10', 'style'=>'margin-right: 5px;' ) ) ); the objective is like this, let's say the user selects date from January 1 to February 1, that's it,OR let's say the user selects January 5 to February 5.. if the user tries to select that has a range of more than 1 month , it should be prevented...how to do that? I have the idea of subtraction, but how? , what's the formula for detecting "if" the selected date range from the two datepicker is already exact 1 month ?
  15. Hey guys, I was just woundering what would be the best way of writing multiple popup functions? I can copy the code few times and change the ID but that doesen't sound efficeint. <script type="text/javascript"> var popUpActive = false; $(document).ready(function(){ //open popup $("#pop").click(function(){ if(popUpActive == false){ $("#flyout").fadeIn(150, function(){ popUpActive = true; }); } }); $(document).click(function(){ if(popUpActive == true) $("#flyout").fadeOut(150, function(){ popUpActive = false; }); }); }); </script>
  16. So with the Topic Tags field just above, when i add a comma it creates a tag. How is that done? And how does it feed into the database?
  17. i'm trying to call a php file using ajax and it seems to be returning false, but i have no idea why. any ideas? <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <form method="get" action="test.php"> <input id="myvar" type="hidden" name="albumid" /> <button type="submit" id="btnsubmit">Submit</button> </form> <script type="text/javascript"> $('form').submit(function() { $.ajax({ url: "newAlbum.php", data: {albumid: $('#myvar').val()}, success: function(data){ var album = data; $('#myvar').val(album); return true; } }); return false; }); </script> newAlbum.php <?php echo '11'; ?> test.php <?php echo $_GET["albumid"]; ?>
  18. Hello, I am building a navigation bar with sub menus which appear when the main item is clicked and disappear when the user clicks elsewhere. I have read numerous posts concerning this topic but I'm not sure how to implement it. My code is as follows: topNav.js <script> var timeout = 50; var closetimer = 0; var ddmenuitem = 0; // open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } // close showed layer function mclose() { if (ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if (closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // need to somehow close layer when click-out </script> Html <body> <div id="main_nav"> <ul id="nav"> <li class="nav"><a href="#" onclick="mopen('m1')"> <span class="nav_parent">CONTACT US</span></a> <div id="m1"> <a href="#">General Inquiries</a> <a href="#">Request a Quote</a> <a href="#">Submit Plans</a> <a href="#">Submit Photos</a> </div></li> </ul> </div> </body> An example of this is at http://jsfiddle.net/schwiegler/t859A/21/
  19. I am building a WordPress website where I want profiles to be displayed directly on the Home page from the Database as members add their profiles. What I have so far is this: If anyone register through the website, their info is stored in a database and their profiles are displayed in a result page. For example: if you use the search form and search for specific member they will display in: http://www.website.com/results/URL (Where results is the page that always display results. Here is the code I have that works just fine: <style> .person_name { font-size:13px; text-align:center; text-transform:uppercase; padding-top:8px; } .person_image { padding:4.2px; border:1px solid #aaa; width:125px; } </style> <?php $state=$_GET['state']; $county=$_GET['county']; $city=$_GET['city']; $zip=$_GET['zip']; /**/ // Make a MySQL Connection mysql_connect("localhost", "user", "pass") or die(mysql_error()); mysql_select_db("user") or die(mysql_error()); // Retrieve all the data from the "example" table $result = mysql_query("SELECT * FROM persons WHERE city='".$city."' OR zip='".$zip."' ORDER BY name") or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<div style='display:inline-block;margin-right:15px;cursor:pointer;' onclick='location=\"http://www.website.com/profile/?id=".str_replace(' ','_',$row["name"])."\"'>"; echo "<div class='person_image'><img src='http://www.website.com/wp-content/uploads/".$row['photo']."' style='' width='125px' /></div>"; echo "<div class='person_name'>".$row['name']."</div>"; echo "</div>"; } /**/ //echo "page for: ".$state." ".$county." ".$city." ".$zip; ?> On my home page and where I want the data to be displayed other than the result page is kinda tricky. I want to be able to only display 6 profiles. I also want to mention that I am using the Execute PHP plugin that helped me display the php in pages. Here is some of my home page code where I want to display those profiles: if ( is_active_sidebar( 'Our Newest Members' ) ) { echo '<div class="Our Newest Members">'; echo '<h4>' . __( 'Our Newest Members', 'themename' ) . '</h4>'; dynamic_sidebar( 'Our Newest Members' ); echo '</div><!-- end .OurNewestMembers -->'; } I am not a code savvy person but always willing to learn and I am also more than happy to answer any follow up questions. Thank you so much for all your help,!!!! John
  20. i have resposive webpage layout with masonry. when user resizes the browser below certain viewport width, i destroy masonry. but after user resized back, i can't reinitialize masonry. it just will not arrange the blocks as it should. any ideas how to fix this?
  21. I want to pull up the data that corresponds to the value of the drop down and show it to a text area within a fieldset, I want my page to just initially show the drop down then after selecting a value it will show the data in a text area without refreshing the page, here is the code: <div id="mainContent"> <table width="619" border="0" align="center"> <td align="center"><form id="form1" name="form1" method="post" action="" > <fieldset> <legend><strong>EA</strong></legend> <p> <select name="ea_name" id="ea_name"> <option value="" selected="selected">Please select...</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> </p> </fieldset> </form></td> </table> <div id="results"></div> </div> Here is the code that I've tried that will pull up data and show to a text area but all im getting is No results found. <?php require 'include/DB_Open.php'; $ea_name = $_POST['ea_name']; $sql="SELECT * FROM ea_error WHERE ea_name = '" . $ea_name . "'"; $myData = mysql_query($sql); //to count if there are any results $numrow = mysql_num_rows($myData); if($numrow == 0) { echo "No results found."; } else { echo '<fieldset><legend><strong>Information</strong></legend><p> <table width="auto" height="172" border="0"> <tr><th>Error</th></tr> <tr><th>Resolution</th></tr> <tr><th>Contact/s</th></tr>'; while($info = mysql_fetch_array($myData)) { echo "<form action='retrieve.php' method='post'>"; echo"<tr>"; echo "<td align='center'>" . $info['error'] . "<input type=hidden name=error value=" . $info['error'] . " </td>"; echo "<td align='center'>" . $info['resolution'] . "<input type=hidden name=resolution value=" . $info['resolution'] . " size='11' maxlength='11' /> </td>"; echo "<td align='center'>" . $info['contacts'] . "<input type=hidden name=contacts value=" . $info['contacts'] . "' /> </td>"; echo "</tr>"; echo "</form>"; } } echo "</fieldset>"; include 'include/DB_Close.php'; ?>
  22. An invoice will be opened in a new window when the Generate invoice button is clicked. Below is the sample code. For Example <form name="invoice" action="inv_rec.php" method="post" id="inv" target="invoices" onsubmit="return check_counter();" > <table> <tr> <td> <label for="cusname"><strong>Customer Name* </strong></label> <input type="text" size="20" name ="cusname" value="" id="Customername" required/> </td> <td> <label for="for_place"><strong>Place</strong></label> <input type="text" size="20" name ="for_place" value="" id="for_place" /> </td> </tr> ........ <tr> <td> <input type="submit" value="Generate Invoice" name="submit" id="sub"> </td> </tr> </table> </form> <script> var counter = 1; function check_counter() { if(counter == 1) { alert("Please enter the product details"); return false; } window.open('', 'invoices', 'width=650,height=800,status=yes,resizable=yes,scrollbars=yes'); return true; } </script> In my example the page will be redirected to inv_rec.php(opens in new window) which contains dynamically generated data obtained from mysql where the user needs to take the print of it. I want to clear all the form data which is open in the previous window(where the invoice form is displayed,i.e user fills the data to generate a invoice).Any help is appreciated.
  23. I am going crazy with my ajax calls. I have finally discovered the issue, but tried numerous ways to fix it with no avail. So essentially I have an ajax call from different levels in the site, there could be from 1 to 4 different directories in the url of the site, which is what causes the issues. function add_cart(pid,quantity) { $.ajax({ type : 'POST', url : '../../ajax/add-cart.php', data : 'pid='+pid+'&quantity='+quantity, success : function() {} }); } I have tried changing the path to http://www.mydomain.com/ajax/add-cart.php, /ajax/add-cart.php, document.location.origin+"/ajax/add-cart.php", "//www.mydomain.com/ajax/add-cart.php" But nothing is working. I am sure I am not the first person to run into this issue, so what is the answer?
  24. I have a page with 2 divs that can be hidden. Now when I load the page the URL looks as follows www.example.com/wedding.php#pyromusicals or it could be www.example.com/wedding.php#just-fireworks now im trying to hide a different div depending on the anchor value and if there is no anchor then hide them both. Here is my code so far $(document).ready(function() { // Get # parameter var param = document.URL.split('#')[1]; if (param == 'pyromusicals') { $(".hidden-div2").hide(); } else if (param == 'purely-fireworks') { $(".hidden-div1").hide(); } }); The problem is that on page load neither works but if you manually hit refresh then the jquery starts working. The links on the page are just html links <li><a href="/wedding-fireworks.php#pyromusicals" title="View information about pyromusical displays for weddings">Pyromusicals</a></li> <li><a href='/wedding-fireworks.php#purely-fireworks' title="View information about wedding fireworks"><span>Purely Fireworks</span></a></li> Any ideas. I am completely new to java and jquery so I'd have no idea where to begin trouble shooting this.
  25. Hi all, I'm new to backbone and JQuery and I'm trying to get my head around it. I'm doing exercise 2 from this book: http://addyosmani.github.io/backbone-fundamentals/#getting-set-up It says "You may notice that the file input for the cover image isn’t working, but that is left as an exercise to the reader." I've tried uploading an image and I get this in the console: GET file:///C:/fakepath/dan_brown.jpg This should be easy enough to do. Anyone got any ideas? Thank you
×
×
  • 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.