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, I'm trying to build a search function for my website with a jQuery auto-complete feature implemented. I have three columns I need to search for in my database, dev_model, dev_version and dev_model_number. Right now I'm just focusing on getting the query to work with the first two columns. The auto-complete works, but its far from perfect and gives undesired results at times. I've tried multiple different approaches to building my search query. So far, doing a full text search is working the best but its far from perfect. Here's my MYSQL query: SELECT id, brand_id, dev_model, dev_version, MATCH (dev_model,dev_version) AGAINST ('+" . $database->escape_values($parts[$i]) . "*' IN BOOLEAN MODE) AS SCORE FROM devices WHERE MATCH (dev_model,dev_version) AGAINST ('+" . $database->escape_values($parts[$i]) . "*' IN BOOLEAN MODE) ORDER BY SCORE DESC LIMIT 4 My search page: http://www.fonefox.com/fonefox/public/index1.php If you search for example 'Galaxy S4', as soon as you start typing the 'S4' (dev_version), the autocomplete hides the Galaxy S4 phone from the search. No idea why, but if the 'dev_version' string is greater then 4 characters it WILL work. Another issue is, you could search 'Galaxy S4 Lumia 1020', and it will return results for a Lumia 1020 which has no relevance to "Galaxy" or "S4". I'm guessing that I need to somehow concatenate dev_model and dev_version before comparing my search terms to it. I'm just not sure how to approach this. Any help would be greatly appreciated.
  2. I have a dynamic php page that has a series of select boxes at the top. When the user changes what is in the select boxes a div at the bottom of the page gets populated with a table via an ajax call to a php script. I am need of a button on that page that a user can click that will give them the option to save that displayed table as a .csv file. I have been looking all over for a solution that will work in both ie and ff, and am not coming up with anything. Any help would be great. Thanks!
  3. I want to have completely custom checkboxes and radio buttons. This would entail: 1. a text label 2. a background icon 3. a hover effect 4. an active effect 5. and a click effect I don't want any checkbox or radio icons, I just want them to look like buttons. I have been experimenting with jquery but dont seem to be able to get much further than the default styling. Any suggestions are much appreciated.
  4. I have the following: The Inspected element from the combo box. <div class="x-combo-list-inner" id="ext-1111"> <div class="x-combo-list-item">Target</div> <div class="x-combo-list-item">Partner</div> <div class="x-combo-list-item">Other</div> <div class="x-combo-list-item x-combo-selected">Too small</div> </div> I am trying to get the selected value "Partner" from it. here's my jquery: $('.x-combo-list-item').click(function() { var item = $(this).data('item'); var isPartner = ??? if (item === (??I'm Stuck here??)) { alert('You have selected Partner!'); // Fire your ajax call here /* $.post('handler.php', {data: data : {even: 'more data'}}, function(data), 'json'); */ } }); I'm stuck on getting the selected value from the COMBO BOX. I did found something online that could be a solution: var isPartner = _getText(_byId("ext-gen484").childNodes[2]); But I'm not sure how to translate that to javascript. Can someone please help me?
  5. Dear all I feel a bit strange to ask in a PHP forum for jQuery help. However, as you offer it, I give it a try. I've made my first steps into jQuery. My script should - have n pictures in an array - display a loading animation while loading the main image Problem: - Loading animation does not appear - I guess it is due to line 42 > $('.image_frame' + i + ' img').load(function() <. It proceeds with the highest value of integer i (3 in this example). - This I guess, is because it is only executed when everything is loaded. - If so, my understanding is wrong of the load function of jQuery: I was expecting it to be assigned to each .image_frame img. I am now stuck on how to get arround that. May I ask for a little help? Oliver Please see below full script. Just copy/ past into an HTML for testing. Mind to have a loading.gif localy. <!DOCTYPE html> <html> <head>Test</head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> // init variables var arr = new Array(); // Create array for testing for (var a = 1; a < 3; a++) { arr[a] = new Array(); arr[a]["URL"] = "www" + a; arr[a]["IMG"] = "http://www2.bmw.de/module/emag/grosskunden_032011/mount/pages/" + a + ".jpg"; arr[a]["USR"] = "usr" + a; arr[a]["AGE"] = a; } var length = arr.length, element = null; $(document).ready(function() { console.log('Document ready function'); for (var i = 1; i < length; i++) { console.log('For loop round ' + i + '. Max. ' + length); var pic = arr[i]["IMG"]; $(".wrap").append("<div class=\"image_frame" + i +"\"><a href=\""+arr[i]["URL"]+"\"><img src=\""+pic+"\" width=\"240\" height=\"160\" class=\"image" + i +"\" alt=\"" + i +"\"></a></div>"); var loader = "<img src=\"loading.gif\" class=\"loaderimg"+i+"\" alt=\"Load…\" />"; // hide original pic $('.image' + i).hide(); //add loading animaiton $('.image_frame' + i).append(loader); $('.image_frame' + i + ' img').load(function() { console.log('Image loaded: ' + i); $('.loaderimg' + i).hide(); $('.image' + i).fadeIn('slow'); }); } }); </script> <style type="text/css"> .wrap { float: left; width: 100%; padding: 30px 0 0 30px; margin: 0 auto; clear: left; } h1 { margin-bottom: 30px; } </style> <body> <div class="wrap"> <h1>Images</h1> <!-- STRUCTURE --- <div class="image_frame"> <a href="http://xxxx"> <img src="http://xxxx.jpg" width="240" height="160" class="image" alt="" /> </a> </div> --> </div> </body> </html>
  6. I want to have my results slide out and slide in just like a carousel. So my results are 3x3, and then whenever you click next, the existing results slide out to the left, and at the same time the new results slide in from the right hand side. If this is done then would it mean I have to download all the results, so they are stored, and can thus slide in immediately, without an ajax load? Or is there some other amazing way to accomplish a task like this?
  7. 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
  8. 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>
  9. 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.
  10. 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)
  11. 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; }
  12. 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
  13. 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
  14. 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
  15. 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.
  16. 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>
  17. 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?
  18. <?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); } ?>
  19. 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
  20. 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 ?
  21. 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>
  22. 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?
  23. 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"]; ?>
  24. 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/
  25. 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
×
×
  • 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.