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. Javascript timer not displaying correctly. It has always displayed properly , but today out of nowhere its just not working the hours and the minutes are not working but , the seconds are counting down. I am new to web development this is the CDN and the external ref to the countdown timer <script type="text/javascript" src= "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script src="countdown.jquery.js"></script> <!-- this is countdown timer script" <!--> <script src="script.js"></script> <!-- this is where countdown timer is refences and where i change the date" <!--> below is the <script src="countdown.jquery.js"> (function($){ $.fn.countdown = function(options){ var settings={'date':null}; if(options){ $.extend(settings,options); } this_sel= $(this); function count_exec(){ eventDate=Date.parse( settings['date']) / 1000; currentDate= Math.floor($.now()/1000); seconds=eventDate -currentDate; days = Math.floor(seconds / (60 * 60 * 24)); seconds -= days * 60 * 60 * 24; hours = Math.floor(seconds / (60 * 60)); seconds -= hours * 60 * 60; minutes = Math.floor(seconds/60); seconds -= minutes * 60; this_sel.find('.days').text(days); this_sel.find('.hours').text(hours); this_sel.find('.mins').text(hours); this_sel.find('.secs').text(seconds); } count_exec(); interval=setInterval(count_exec,1000); } }) (jQuery); this is the jquery file <script src="script.js"></script> $(document).ready(function(){ $('#countdown').countdown({date: '26 January 2014 10:00:00'}); });
  2. Hello! Second post here. I'm new to PHP and have an idea of what needs to be done, but im not sure the best way to impliment it. Basically im looking for direction on whether I should use JS, AJAX, Jquery, or something else. from browsing around im guessing its going to be a combination of AJAX and Jquery to get this accomplished. Please advise on the best method to acomplish this. Thanks =) The user needs to populate txtAddr and hit btnGen. The function will then confirm txtAddr is equal to a variable. If it is equal, populate other 2 text fields (txtKey & txtDest) with predefined variables. <form action="frmGen" method="post"> <input name="txtAddr" type="text"> <!-- User enters text here -- Confirm txtAddr.text = $VarAddr -- If True, continue. If False, display DIV message --> <input name="txtDest" type="text"> <!-- Text field is filled with value from server/SQL when btnGen is pressed--> <input name="txtKey" type="text"> <!-- Text field is filled with value from server/SQL when btnGen is pressed--> <input name="btnGen" type="button"> <!-- assuming txtAddr is True, display strings in 2 text fields above & store all values from 3 text boxes in SQL --> </form>
  3. Hello, I'm trying to make a sliding bar or how you would describe it. And as the topic says, not a imageslider, where it takes a couple seconds before it changes picture.... I tried to come up with something in Paint to describe what I mean... A rolling bar so to say. I searched the webz like a maniac but only found sliders for images and other random stuff that isn't what I need, so I would hope someone of you guys might know how to do this. I'll attach the image. Thanks in advanced, peace!
  4. I have never done any jQuery programming before, and I am having a hell of a time finding a tutorial to do what I would like. Maybe I am looking for the wrong thing? I have this scenario: I have a product that has two or more images. I have one div where the product image is displayed. What I would like to do is have a 'next' and 'previous' button that cycles through the product images. I would love to use a professional gallery with transitions etc, but the image sizes vary, and so the div size must be dynamic like the image sizes. I was thinking of simply changing the contents of a div to change images. Something like this: <div id="imagediv"><img src="1.jpg" /></div> --> *next* button is clicked --> jQuery updates the div so that its contents become: <div id="imagediv"><img src="2.jpg" /></div> Is this possible? If the image sizes are different, is this possible? Cheers.
  5. I'm not really sure were this belongs because I don't really know which part of my script is causing the problem. So I have screen printed my issue. I think screen printing and showing you guys what my problems are is a great idea rather then me trying to explain myself. Pictures show more than words. But anyways. My main problem is that I want to insert the data "privacy=everyone" into it's own separate column, but also take the "privacy" out and insert into the column with the data "everyone". This is what I got so far. This is my issue I have on a live page. I cropped everything out except the issue. Here is my PHP code. Here is my Jquery code. And here is my MySQL data. My ideal MySQL data would look something like this. If I forgot something, I'll edit this post. EDIT: I should also mention that some of the PHP codes are whiten out in case of coping. The status and category are suppose to be one, but I had whiten out the other codes so the category and status looks like they're not aligned, but they are in my real code.
  6. i am creating a timesheet in php , i need a logic to update the database , the working is as follows 1. accept employee_id and date , from date get week number , query database with this input as follows my database task3 contains and id , emp_id , p_name , time , taskdate mysql_query("SELECT p_name, SUM(IF(DAYOFWEEK(taskdate) = 2, `time`, 0)) AS `MO`, SUM(IF(DAYOFWEEK(taskdate) = 3, `time`, 0)) AS `TU`, SUM(IF(DAYOFWEEK(taskdate) = 4, `time`, 0)) AS `WE`, SUM(IF(DAYOFWEEK(taskdate) = 5, `time`, 0)) AS `TH`, SUM(IF(DAYOFWEEK(taskdate) = 6, `time`, 0)) AS `FR`, SUM(IF(DAYOFWEEK(taskdate) = 7, `time`, 0)) AS `SA`, SUM(IF(DAYOFWEEK(taskdate) = 1, `time`, 0)) AS `SU` FROM task3 WHERE e_id = '$r' AND WEEK(`taskdate`,-1) ='$week' GROUP BY p_name "); this is returned through ajax onto my page , and then i can change date and get the result ,(check the attachments) i want to update the textboxes , this is my issue , i need a logic to get left-mist coloumn project_name and top coloumn date . table is created in php , with textboxes and values set to those coming from database ,
  7. Hi, I dont know if this is a wrong category to post. I have a registration form in my website. I need a overlay popup after the sucessfull registration process. Can someone help me. Thanks in advance. Regards..
  8. when click on the add new button table , label , textboxes(html form) , all apear same as above...view in photo
  9. I'm building a trade site for virtual currencies like bitcoin and such. i need a bit of help as well as some general feedback on the site(be forwarned, it looks pretty crappy in non webkit browsers like firefox and ie. i probably should be developing for those browsers as well, but i feel like they are inferior and will be forgotten soon enough. this being said, here is the link to the site https://openex.pw testusers: test123 | 12345678 TraderBob | 12345678 test2 | password test5 | password help i need: Chat: I need a way to autoscroll the window down, but unfortunately i haven't been able to get it to work. code always seems to break. $(document).ready(function() { //load messages $('#messages').load('ajaxLOAD.php'); $('#ajaxPOST').submit(function() { $.post('ajaxPOST.php', $('#ajaxPOST').serialize(), function(data){ //clear the message field $('#message').val(''); //reload messages $('#messages').delay(1000).load('ajaxLOAD.php'); }); return false; }); }); Logout.php This was working before i built the chat, but since i find that logging out no longer redirects back to the homepage. if (isUserLoggedIn()) { $loggedInUser->userLogOut(); echo"<p class='notify-green' id='notify'>You are now logged out.</p>"; header('Refresh: 2; url=https://openex.pw'); }else{ header( 'Location: index.php'); die(); }
  10. Hello all, new to the forum. I have been struggling with a PHP problem for the past week and have turned to you as a last resort. I have everything set up mostly right, but there are specific features that I need from http://datatables.net/index that I would love to feature on my inventory page. What happens on my page, is that the whole csv contents show. But the rows do not hide as in the examples you can see on the datatables website. The search bar also does not appear. These are standard features nestled within the datatables.js code. So I am guess they disappear because of the way the PHP is set up to view the rows. These features are really important for the future functionality of my site as well! I have the PHP code as follows: <?php set_time_limit(0); function csv_split($line,$delim=',',$removeQuotes=true) { #$line: the csv line to be split #$delim: the delimiter to split by #$removeQuotes: if this is false, the quotation marks won't be removed from the fields $fields = array(); $fldCount = 0; $inQuotes = false; for ($i = 0; $i < strlen($line); $i++) { if (!isset($fields[$fldCount])) $fields[$fldCount] = ""; $tmp = substr($line,$i,strlen($delim)); if ($tmp === $delim && !$inQuotes) { $fldCount++; $i += strlen($delim)-1; } else if ($fields[$fldCount] == "" && $line[$i] == '"' && !$inQuotes) { if (!$removeQuotes) $fields[$fldCount] .= $line[$i]; $inQuotes = true; } else if ($line[$i] == '"') { if ($line[$i+1] == '"') { $i++; $fields[$fldCount] .= $line[$i]; } else { if (!$removeQuotes) $fields[$fldCount] .= $line[$i]; $inQuotes = false; } } else { $fields[$fldCount] .= $line[$i]; } } return $fields; } $html_body = '<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="/css/demo_page.css"> <link rel="stylesheet" type="text/css" href="/css/demo_table.css"> <title>CSV Contents</title> <style type="text/css"> <!-- .style5 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; } .style9 {font-size: 12px} .logo h1 {position: absolute; top: 5px; right: 5px; font-size:14px; } .logo img-with-text {float: left; left 5px; font-size:14px; .img-with-text {text-align: justify; width: 40%; height: 20%;} .img-with-text img {display: block; margin: 0 auto;} .search {margin : 0px;} --> </style> <script class="jsbin" src="http://datatables.net/download/build/jquery.dataTables.nightly.js"></script> <script type="text/javascript" language="javascript" src="/js/jquery.js"></script> <div class="img-with-text"> <img src="/image002.png" alt="sometext" /> <p>WC" is West Coast warehouse- please add approximately 2-3 weeks for the arrival to East Coast.<br><br> </p> </div> <div class="logo"> <br>Last Updated on '.date("F j, Y, g:i a",time()+3600).' </h1> </div> </head> <body id="dt_example"> <div id="container"> <h1> Check Inventory Here</h1> <table> <thead> <tr> <th>Item No</th> <th>Description</th> <th>Price</th> <th>Available</th> <th>Back Ordered</th> <th>On Order</th> <th>ETA WH</th> <th>WC On Hand</th> <th>WC On Ord</th> <th>WC Order Date</th> </tr> </thead> <tbody> '; $fp=fopen("csv/inventory4.html",'w'); $write=fputs($fp,$html_body,strlen($html_body)); $i=0; $content = file("webinvt.txt"); foreach($content as $line) { $l=csv_split($line); if(!strstr($l[11],"SET")) { if($i==10) { $tmp = '<tr>'; $write=fputs($fp,$tmp,strlen($tmp)); $i=0; } $onhand = (int)$l[15]; $committed = (int)$l[16]; $avail = $onhand - $committed; $wcdate = substr($l[23],4); $eastdate = substr($l[19],4); if(strstr($l[1],"DISC")) { $html_body ='<tr "> <td>'.$l[0].'</td> <td>'.$l[1].'</td> <td>'.$l[12].'</td> <td>'.$avail.'</td> <td>'.$l[17].'</td> <td>'.$l[18].'</td> <td>'.$eastdate.'</td> <td>'.$l[21].'</td> <td>'.$l[22].'</td> <td>'.$wcdate.'</td> </tr>'; } else { $html_body ='<tr> <td>'.$l[0].'</td> <td>'.$l[1].'</td> <td>'.$l[12].'</td> <td>'.$avail.'</td> <td>'.$l[17].'</td> <td>'.$l[18].'</td> <td>'.$eastdate.'</td> <td>'.$l[21].'</td> <td>'.$l[22].'</td> <td>'.$wcdate.'</td> </tr> '; } $write=fputs($fp,$html_body,strlen($html_body)); $i++; } } $html_body=' </tbody> <tfoot> <tr> <th>Item No</th> <th>Description</th> <th>Price</th> <th>Available</th> <th>Back Ordered</th> <th>On Order</th> <th>ETA WH</th> <th>WC On Hand</th> <th>WC On Ord</th> <th>WC Order Date</th> </tr> </tfoot> </table> </body> </html>'; $write=fputs($fp,$html_body,strlen($html_body)); fclose($fp); ?> Furthermore, I have to include this piece of javascript inside the HTML variable.: $(document).ready(function() { $('#example').dataTable(); } ); Any help will be greatly appreciated!
  11. I'm completely stuck and I need help. I've been trying to create a picture framing utility (for photos etc). where the user can specify the size of their photo, then choose a coloured cardboard mount and a frame type to go around it. The site my client chose for me to create something similar to is this: http://www.ezeframe.co.uk/picture-frames You can see that the user can specify their picture size, frame and mount, and see it taking shape on screen. Where I've come unstuck is the scaling. You can see in the above example that if someone changes their mount size or frame type, they change so that they remain in proportion to the picture size. I've been trying to make my system do the same and I'm failing! I'm sure it's my maths that's wrong but can't work out where. What I've done so far (without scaling) can be seen on the clients live site here: www.vivarti.co.uk/bespoke-frames I've done it mostly using CSS, Jquery and AJAX. The way it works is that I have a fixed pixel area to work within. When the user alters the size of frame moulding, or the cardboard mount, it needs to scale the 'image area', mount and frame in proportion. I've tried doing it using fixed pixel width, percentage width and every other way I can think of, but I still can't get it to work properly. Is there a better way to do this kind of thing than using Jquery, or can anyone help me work out the maths to make my version scale? A tall order I know but I'm just hoping someone can help me! Thanks in advance.
  12. I downloaded this source package for a poll system that runs on jquery and php. Here is the "to do" list to make the program work. 1. Setup mysql database to have one row and x number of columns (however many questions in poll). 2. Configure updatePoll.php with database location, name, and password. 3. Include in index.php file the required JS: createPoll.js style.css from jQuery: jquery-1.4.4.min.js jquery.ui.core.js jquery.easing.1.3.js jquery.core.js 4. Load index.html in your browser! i 5. Style poll questions using the style.css, and/or change to be traditional poll (i.e. radio buttons). 6. Demo: http://www.bheberto.com/devblog.php?id=5 I got steps 1 and 2 done. I also got part of 3 done. How do you include the jquery-1.4.4.min.js? is that something your download? I know nothing about jquery, I only know php, html, and css right now. index.html style.css updatePoll.php
  13. im using the jquery UI datepicker to submit a date to my database but i keep storing 0000-00-00 instead of the date how do I make the date show up in the database? can someone help me?
  14. Hi Guys and Gals The below code reads from a database and builds a tree structure. But my problem is in the collapse and expanding of the 'child' tr. Currently it expands the next tr, but if there is more than 1 child you have to first click the first chhild to expand the second child and so forth. Is there a way with jquery to expand a class until the next occurance of another class? <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> </head> <?php mysql_connect('localhost','root',''); mysql_select_db('samaedbm'); ini_set('display_errors', 1); ini_set('memory_limit', '640M'); ini_set('max_execution_time', 6000); error_reporting(E_ALL); function addnode($pid, $ind, $search){ global $modx; $sql = "select * from edbm_content where parentid = '".$pid. "' and description like '%". $search . "%'"; $ind .= '-'; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)){ if ($pid == $row["id"]) { if (strlen($ind) == 1){ echo '<tr class="header0" id="header0"><td><span class="expanderSign">[+]</span> ' . $row["description"].'</td><td>'.$row["parentid"].'</td><td>'.$row["id"].'</td></tr>'; } } if ($pid != $row["id"]) { if (strlen($ind) == 1){ echo '<tr class="header1" id="header1" style="display:none;"><td style="padding-left:10px;"><span class="expanderSign">[+]</span> ' . $row["description"].'</td><td>'.$row["parentid"].'</td><td>'.$row["id"].'</td></tr>'; } if (strlen($ind) == 2){ echo '<tr class="header2" id="header2" data-for="header1" style="display:none;"><td style="padding-left:20px;"><span class="expanderSign">[+]</span> ' . $row["description"].'</td><td>'.$row["parentid"].'</td><td>'.$row["id"].'</td></tr>'; } if (strlen($ind) == 3){ echo '<tr data-for="header3" style="display:none;"><td style="padding-left:30px;"><span class="expanderSign">[+]</span> ' . $row["description"].'</td><td>'.$row["parentid"].'</td><td>'.$row["id"].'</td></tr>'; } addnode($row["id"], $ind, $search); } } return; } echo '<table style="font-size:13;">'; addnode(505000, '', ''); echo '</table>'; ?> <script type="text/javascript"> $(".header0").click(function() { $(".header1").slideToggle(500); if (jQuery(".expanderSign").text() == "[+]"){ jQuery(".expanderSign").text("[-]"); } else { jQuery(".expanderSign").text("[+]"); } }); $(".header1").children("td").click(function() { $(obj).closest('tr').nextAll(':has(.header2):first').find('.header2').show(); if (jQuery(".expanderSign").text() == "[+]"){ jQuery(".expanderSign").text("[-]"); } else { jQuery(".expanderSign").text("[+]"); } }); $(".header2").children("td").click(function() { $(this).parent().next("tr").show(); if (jQuery(".expanderSign").text() == "[+]"){ jQuery(".expanderSign").text("[-]"); } else { jQuery(".expanderSign").text("[+]"); } }); </script>
  15. Hello, I am looking for someone that can redesign my old form and make some validation changes... Things I need the form to do: Confirm leaving the page, if it is done other than by submitting the form There is a place for three different phone numbers, home, work, and mobile, I only need to ensure that at least one of those is filled out, more can be, but one is required Proper character input type validation, phone numbers, zip code, email address Required fields, some of which are of the HTML "select" type of input Format masking, e.g. phone numbers Needs to be multi-browser compatible, Firefox, Chrome, IE, Safari The form needs to be smooth and curvy, very jQuery / AJAX Convert the MySQL to MySQLi The form should have it's own css, so that it can stand alone on it's own, but not conflict with other css either, e.g. start all of it's css with something like "form_" or something Improve upon the PHP as you see fit If you can make or add a better way to put in a date of birth, other than 3 drop-down boxes, then that would be good as well In the form there is also a question of whether or not an address is the same as another address, if so, it copies the address info, if not, it shows a new div, for a new address, the form will still need that functionality as well P.S. The form is called via an SSL secure page Please contact me with your quotes and any forms that you would like to show off, at motorsportfun2013 [@] gmail dot com Since I apparently can't attach the page, I'll post the code of what I'm currently using... <? require 'includes/auth.php'; $AgentID = $_SESSION['AgentID']; $AgentName = $_SESSION['AgentName']; if (isset($_GET['orderticketid'])) { $orderticketid = clean($_GET['orderticketid']); $result = mysql_query(" SELECT OrderTickets.*, Agencies.AgencyName, InsuranceCarriers.InsuranceCarrier FROM OrderTickets LEFT JOIN Agencies ON OrderTickets.AgencyID = Agencies.AgencyID LEFT JOIN InsuranceCarriers ON OrderTickets.InsuranceCarrierID = InsuranceCarriers.InsuranceCarrierID WHERE OrderTickets.OrderTicketID = '$orderticketid' AND OrderTickets.AgentID = '$AgentID' "); while ($OrderTicketRow = mysql_fetch_assoc($result)) { $InsuranceCarrierID = $OrderTicketRow['InsuranceCarrierID']; $InsuranceCarrierPolicyNumber = $OrderTicketRow['InsuranceCarrierPolicyNumber']; $OrderTicketFirstName = $OrderTicketRow['OrderTicketFirstName']; $OrderTicketMiddleName = $OrderTicketRow['OrderTicketMiddleName']; $OrderTicketLastName = $OrderTicketRow['OrderTicketLastName']; $OrderTicketAddress = $OrderTicketRow['OrderTicketAddress']; $OrderTicketCity = $OrderTicketRow['OrderTicketCity']; $OrderTicketState = $OrderTicketRow['OrderTicketState']; $OrderTicketZipCode = $OrderTicketRow['OrderTicketZipCode']; $OrderTicketExamLocation = $OrderTicketRow['OrderTicketExamLocation']; $OrderTicketExamLocationAddress = $OrderTicketRow['OrderTicketExamLocationAddress']; $OrderTicketExamLocationCity = $OrderTicketRow['OrderTicketExamLocationCity']; $OrderTicketExamLocationState = $OrderTicketRow['OrderTicketExamLocationState']; $OrderTicketExamLocationZipCode = $OrderTicketRow['OrderTicketExamLocationZipCode']; $OrderTicketHomePhone = $OrderTicketRow['OrderTicketHomePhone']; $OrderTicketWorkPhone = $OrderTicketRow['OrderTicketWorkPhone']; $OrderTicketMobilePhone = $OrderTicketRow['OrderTicketMobilePhone']; $OrderTicketEmailAddress = $OrderTicketRow['OrderTicketEmailAddress']; $OrderTicketDOBMonth = date('m', strtotime($OrderTicketRow['OrderTicketDOB'])); $OrderTicketDOBDay = date('d', strtotime($OrderTicketRow['OrderTicketDOB'])); $OrderTicketDOBYear = date('Y', strtotime($OrderTicketRow['OrderTicketDOB'])); $OrderTicketGender = $OrderTicketRow['OrderTicketGender']; $OrderTicketSmoker = $OrderTicketRow['OrderTicketSmoker']; $OrderTicketPolicyType = $OrderTicketRow['OrderTicketPolicyType']; $OrderTicketPolicyAmount = $OrderTicketRow['OrderTicketPolicyAmount']; $OrderTicketSpecialInstructions = $OrderTicketRow['OrderTicketSpecialInstructions']; } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> <link rel="shortcut icon" href="images/favicon.ico" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script> <script type="text/javascript" src="includes/JavaScriptValidationFunctions.js"></script> <script type="text/javascript" src="includes/Modernizr-2.5.3.forms.js"></script> <script type="text/javascript" data-webforms2-support="validation" src="includes/html5Forms.js"></script> <script src="includes/jquery.maskedinput-1.3.min.js" type="text/javascript"></script> <script type="text/javascript"> jQuery(document).ready(function() { jQuery("#OrderTicketHomePhone").mask("(999) 999-9999"); jQuery("#OrderTicketWorkPhone").mask("(999) 999-9999"); jQuery("#OrderTicketMobilePhone").mask("(999) 999-9999"); }); </script> <script type="text/javascript"> window.onbeforeunload = function() { return 'You have unsaved changes!'; } </script> <script type="text/javascript"> function ShowHide(){ if (document.getElementById("OrderTicketExamLocation").value == '') { $('.show_hide').hide(); } if (document.getElementById("OrderTicketExamLocation").value != 'Home') { $('.show_hide').show(); } else if (document.getElementById("OrderTicketExamLocation").value == 'Home') { $('.show_hide').hide(); } } </script> <title>Submit Order Ticket</title> </head> <body> <div id="LogoHeader"> <img src="images/logo.png" /> </div> <div id="Menu"> <? include 'includes/menu.php'; ?> </div> <div class="jQueryErrors"> </div> <div id="OrderForm"> <br /> <form id="submitorderform" action="submitorderticket-action.php" method="post" onsubmit="return validateOrderSubmissionForm();"> <input id="submitneworderticket" name="submitneworderticket" value="submitneworderticket" type="hidden" /> <fieldset> <div class="FormRow"> <div class="FormLabel"> <label for="InsuranceCarrierID">* Insurance Carrier:</label> </div> <div class="FormInput"> <? $CarriersResult = mysql_query("SELECT InsuranceCarriersAgents.InsuranceCarrierID, InsuranceCarriers.InsuranceCarrier FROM InsuranceCarriersAgents LEFT JOIN InsuranceCarriers ON InsuranceCarriersAgents.InsuranceCarrierID = InsuranceCarriers.InsuranceCarrierID WHERE InsuranceCarriersAgents.AgentID = '$AgentID'") or die(mysql_error()); $rowCounter = mysql_num_rows($CarriersResult); if ($rowCounter == 0) { echo '<span style="background-color: #C0C0C0; color: red; padding: 2px;">You Are Not Associated With Any Insurance Carriers, Click On <a href="carrier-agent-correlations.php">Insurance Carriers</a> To Add It/Them.<span>'; } if ($rowCounter > 1) { echo '<select id="InsuranceCarrierID" name="InsuranceCarrierID">'; echo '<option value=""> ... </option>'; } while ($temprow = mysql_fetch_assoc($CarriersResult)) { if ($rowCounter == 1) { echo '<input type="hidden" id="InsuranceCarrierID" name="InsuranceCarrierID" value="'.$temprow['InsuranceCarrierID'].'" />'; echo '<input style="color: #515151;" type="text" id="InsuranceCarrier" name="InsuranceCarrier" value="'.$temprow['InsuranceCarrier'].'" size="50" READONLY />'; } if ($rowCounter > 1) { echo '<option value="'.$temprow['InsuranceCarrierID'].'">'.$temprow['InsuranceCarrier'].'</option>'; } } if ($rowCounter > 1) { echo '</select>'; } ?> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="AgencyID">* Agency Name:</label> </div> <div class="FormInput"> <? $AgenciesResult = mysql_query("SELECT AgenciesAgents.AgencyID, Agencies.AgencyName FROM AgenciesAgents LEFT JOIN Agencies ON AgenciesAgents.AgencyID = Agencies.AgencyID WHERE AgenciesAgents.AgentID = '$AgentID'") or die(mysql_error()); $rowCounter = mysql_num_rows($AgenciesResult); if ($rowCounter == 0) { echo '<span style="background-color: #C0C0C0; color: red; padding: 2px;">You Are Not Associated With Any Agencies, Please Call ParaMedDirect.<span>'; } if ($rowCounter > 1) { echo '<select id="AgencyID" name="AgencyID">'; echo '<option value=""> ... </option>'; } while ($temprow = mysql_fetch_assoc($AgenciesResult)) { if ($rowCounter == 1) { echo '<input type="hidden" id="AgencyID" name="AgencyID" value="'.$temprow['AgencyID'].'" />'; echo '<input style="color: #515151;" type="text" id="AgencyName" name="AgencyName" value="'.$temprow['AgencyName'].'" size="50" READONLY />'; } if ($rowCounter > 1) { echo '<option value="'.$temprow['AgencyID'].'">'.$temprow['AgencyName'].'</option>'; } } if ($rowCounter > 1) { echo '</select>'; } ?> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="AgentID">* Agent Name:</label> </div> <div class="FormInput"> <input type="hidden" id="AgentID" name="AgentID" value="<? echo $AgentID; ?>" /> <input style="color: #515151;" type="text" id="AgentName" name="AgentName" value="<? echo $AgentName; ?>" READONLY /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="InsuranceCarrierPolicyNumber"> Policy Number:</label> </div> <div class="FormInput"> <input id="InsuranceCarrierPolicyNumber" name="InsuranceCarrierPolicyNumber" type="text" value="<? echo $InsuranceCarrierPolicyNumber; ?>" /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketFirstName">* Client Name:</label> </div> <div class="FormInput"> <input id="OrderTicketFirstName" name="OrderTicketFirstName" type="text" value="<? echo $OrderTicketFirstName; ?>" required /> <input id="OrderTicketMiddleName" name="OrderTicketMiddleName" type="text" value="<? echo $OrderTicketMiddleName; ?>" size="1" /> <input id="OrderTicketLastName" name="OrderTicketLastName" type="text" value="<? echo $OrderTicketLastName; ?>" required /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketAddress">* Address:</label> </div> <div class="FormInput"> <input id="OrderTicketAddress" name="OrderTicketAddress" type="text" value="<? echo $OrderTicketAddress; ?>" required size="50" /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketCity">* City:</label> </div> <div class="FormInput"> <input id="OrderTicketCity" name="OrderTicketCity" type="text" value="<? echo $OrderTicketCity; ?>" required /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketState">* State:</label> </div> <div class="FormInput"> <select id="OrderTicketState" name="OrderTicketState"> <option value=""> ... </option> <? $StateResult = mysql_query("SELECT * FROM States WHERE 1"); while ($StateRow = mysql_fetch_assoc($StateResult)) { echo '<option value="'.$StateRow['StateAbbr'].'"'; if ($StateRow['StateAbbr'] == $OrderTicketState){echo ' SELECTED';} elseif ($StateRow['StateAbbr'] == "MO"){echo ' SELECTED';} echo '>'.$StateRow['State'].'</option>'; } ?> </select> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketZipCode">* Zip Code:</label> </div> <div class="FormInput"> <input id="OrderTicketZipCode" name="OrderTicketZipCode" type="text" value="<? echo $OrderTicketZipCode; ?>" pattern="[0-9]{5}" required /> </div> </div> <br /> <div class="FormRow"> <span style="font-weight: 600;">Enter Exam Location if Different from Client Location.</span> </div> <br /> <div class="FormRow"> <div class="FormLabel" style="padding-left: 15px;"> <label for="OrderTicketExamLocation">Exam Location:</label> </div> <div class="FormInput"> <select id="OrderTicketExamLocation" name="OrderTicketExamLocation" onchange="ShowHide()"> <? $ExamLocationResult = mysql_query("SELECT * FROM ExamLocations"); while ($ExamLocationRow = mysql_fetch_assoc($ExamLocationResult)) { echo '<option value="'.$ExamLocationRow['ExamLocation'].'"'; if ($ExamLocationRow['ExamLocation'] == $OrderTicketExamLocation){echo ' SELECTED';} echo '>'.$ExamLocationRow['ExamLocation'].'</option>'; } ?> </select> </div> </div> <br /> <div class="show_hide"> <div class="FormLabel" style="padding-left: 15px;"> <label for="OrderTicketExamLocationAddress">Exam Location Address:</label> </div> <div class="FormInput"> <input id="OrderTicketExamLocationAddress" name="OrderTicketExamLocationAddress" type="text" value="<? echo $OrderTicketExamLocationAddress; ?>" size="50" /> </div> </div> <br /> <div class="show_hide"> <div class="FormLabel" style="padding-left: 15px;"> <label for="OrderTicketExamLocationCity">Exam Location City:</label> </div> <div class="FormInput"> <input id="OrderTicketExamLocationCity" name="OrderTicketExamLocationCity" type="text" value="<? echo $OrderTicketExamLocationCity; ?>" /> </div> </div> <br /> <div class="show_hide"> <div class="FormLabel" style="padding-left: 15px;"> <label for="OrderTicketExamLocationState">Exam Location State:</label> </div> <div class="FormInput"> <select id="OrderTicketExamLocationState" name="OrderTicketExamLocationState"> <option value=""> ... </option> <? $StateResult = mysql_query("SELECT * FROM States"); while ($StateRow = mysql_fetch_assoc($StateResult)) { echo '<option value="'.$StateRow['StateAbbr'].'"'; if ($StateRow['StateAbbr'] == $OrderTicketExamLocationState){echo ' SELECTED';} elseif ($StateRow['StateAbbr'] == "MO"){echo ' SELECTED';} echo '>'.$StateRow['State'].'</option>'; } ?> </select> </div> </div> <br /> <div class="show_hide"> <div class="FormLabel" style="padding-left: 15px;"> <label for="OrderTicketExamLocationZipCode">Exam Location Zip Code:</label> </div> <div class="FormInput"> <input id="OrderTicketExamLocationZipCode" name="OrderTicketExamLocationZipCode" type="text" value="<? echo $OrderTicketExamLocationZipCode; ?>" pattern="[0-9]{5}" /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketHomePhone">* Home Phone:</label> </div> <div class="FormInput"> <input id="OrderTicketHomePhone" name="OrderTicketHomePhone" type="tel" value="<? echo formatPhone($OrderTicketHomePhone); ?>" required /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketWorkPhone"> Work Phone:</label> </div> <div class="FormInput"> <input id="OrderTicketWorkPhone" name="OrderTicketWorkPhone" type="tel" value="<? echo formatPhone($OrderTicketWorkPhone); ?>" /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketMobilePhone"> Mobile Phone:</label> </div> <div class="FormInput"> <input id="OrderTicketMobilePhone" name="OrderTicketMobilePhone" type="tel" value="<? echo formatPhone($OrderTicketMobilePhone); ?>" /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketEmailAddress"> Email Address:</label> </div> <div class="FormInput"> <input id="OrderTicketEmailAddress" name="OrderTicketEmailAddress" type="email" size="50" value="<? echo $OrderTicketEmailAddress; ?>" /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketDOBMonth">* Date of Birth:</label> </div> <div class="FormInput"> <select id="OrderTicketDOBMonth" name="OrderTicketDOBMonth"> <option value=""> ... </option> <? for ($i=1;$i<13;$i++) { $i = sprintf('%02d', $i); echo '<option value="'.$i.'"'; if ($i == $OrderTicketDOBMonth) {echo ' SELECTED';} echo '>'.$i.'</option>'; } ?> </select> <select id="OrderTicketDOBDay" name="OrderTicketDOBDay"> <option value=""> ... </option> <? for ($i=1;$i<32;$i++) { $i = sprintf('%02d', $i); echo '<option value="'.$i.'"'; if ($i == $OrderTicketDOBDay) {echo ' SELECTED';} echo '>'.$i.'</option>'; } ?> </select> <select id="OrderTicketDOBYear" name="OrderTicketDOBYear"> <option value=""> ... </option> <? $thisYear = date('Y'); for ($i=1900;$i<$thisYear;$i++) { echo '<option value="'.$i.'"'; if ($i == $OrderTicketDOBYear){echo ' SELECTED';} echo '>'.$i.'</option>'; } ?> </select> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketGender">* Gender:</label> </div> <div class="FormInput"> <select id="OrderTicketGender" name="OrderTicketGender"> <option value=""> ... </option> <option value="Male" <? if ($OrderTicketGender == "Male"){echo ' SELECTED';} ?>>Male</option> <option value="Female" <? if ($OrderTicketGender == "Female"){echo ' SELECTED';} ?>>Female</option> </select> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketSmoker">* Tobacco User:</label> </div> <div class="FormInput"> <select id="OrderTicketSmoker" name="OrderTicketSmoker"> <option value=""> ... </option> <option value="Yes" <? if ($OrderTicketSmoker == "Yes"){echo ' SELECTED';} ?>>Yes</option> <option value="No" <? if ($OrderTicketSmoker == "No"){echo ' SELECTED';} ?>>No</option> <option value="NA" <? if ($OrderTicketSmoker == "NA"){echo ' SELECTED';} ?>>Not Applicable</option> </select> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketPolicyType">* Policy Type:</label> </div> <div class="FormInput"> <select id="OrderTicketPolicyType" name="OrderTicketPolicyType"> <option value=""> ... </option> <option value="LifeTerm" <? if ($OrderTicketPolicyType == "LifeTerm"){echo ' SELECTED';} ?>>Life (term)</option> <option value="LifeVariable" <? if ($OrderTicketPolicyType == "LifeVariable"){echo ' SELECTED';} ?>>Life (variable)</option> <option value="Disability" <? if ($OrderTicketPolicyType == "Disability"){echo ' SELECTED';} ?>>Disability</option> <option value="Health" <? if ($OrderTicketPolicyType == "Health"){echo ' SELECTED';} ?>>Health</option> <option value="LTC" <? if ($OrderTicketPolicyType == "LTC"){echo ' SELECTED';} ?>>LTC</option> </select> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketPolicyAmount">* Policy Amount:</label> </div> <div class="FormInput"> <input id="OrderTicketPolicyAmount" name="OrderTicketPolicyAmount" type="text" value="<? if ($OrderTicketPolicyAmount != 0) echo number_format($OrderTicketPolicyAmount, 2); ?>" required /> </div> </div> <br /> <div class="FormRow"> <div class="FormLabel"> <label for="OrderTicketSpecialInstructions"> Special Instructions:</label> </div> <div class="FormInput"> <textarea id="OrderTicketSpecialInstructions" name="OrderTicketSpecialInstructions" cols="40" rows="7"><? echo $OrderTicketSpecialInstructions; ?></textarea> </div> </div> <br /> <div class="FormRow"> <div class="FormSubmit"> <input id="submit" type="submit" value="Submit" /> </div> </div> <br /> </fieldset> <div id="sitesealdiv"> <span id="siteseal"><script type="text/javascript" src="https://seal.godaddy.com/getSeal?sealID=nezI8DdJpwJdyKY47vVrSgFuL1UYVfwDggv4JN4ykS5AumDDidYzrl"></script></span> </div> </form> </div> </body> </html>
  16. I have this bellow code its a jquery to add form elements dynamically. my question is when Im submiting the form to the database it only send first set of elements value only, rest are not sending to the database, plz help me on this.. here is my codes. jquery- <script type="text/Javascript"> $(document).ready(function() { $('#btnAdd').click(function() { var num = $('.clonedSection').length; var newNum = new Number(num + 1); var newSection = $('#pq_entry_' + num).clone().attr('id', 'pq_entry_' + newNum); newSection.children(':first').children(':first').attr('id', 'contNo_' + newNum).attr('name', 'contNo_' + newNum); newSection.children(':nth-child(2)').children(':first').attr('id', 'contNo2_' + newNum).attr('name', 'contNo2_' + newNum); newSection.children(':nth-child(3)').children(':first').attr('id', 'contNo3_' + newNum).attr('name', 'contNo3_' + newNum); newSection.children(':nth-child(4)').children(':first').attr('id', 'contNo4_' + newNum).attr('name', 'contNo4_' + newNum); newSection.children(':nth-child(5)').children(':first').attr('id', 'contNo5_' + newNum).attr('name', 'contNo5_' + newNum); newSection.children(':nth-child(6)').children(':first').attr('id', 'contNo6_' + newNum).attr('name', 'contNo6_' + newNum); newSection.insertAfter('#pq_entry_' + num).last(); $('#btnDel').prop('disabled',''); if (newNum == 5) $('#btnAdd').prop('disabled','disabled'); }); $('#btnDel').click(function() { var num = $('.clonedSection').length; // how many "duplicatable" input fields we currently have $('#pq_entry_' + num).remove(); // remove the last element // enable the "add" button $('#btnAdd').prop('disabled',''); // if only one element remains, disable the "remove" button if (num-1 == 1) $('#btnDel').prop('disabled','disabled'); }); $('#btnDel').prop('disabled','disabled'); }); //$('#blinfo').on('submit', function (e) { //prevent the default submithandling // e.preventDefault(); //send the data of 'this' (the matched form) to yourURL // $.post('bladd.php', $(this).serialize()); //}); </script> Here is the HTML (both codes are in the same file) <ul id="pq_entry_1" class="clonedSection"> <li><input type="text" name="contNo_1" id="contNo_1" size="45" value=""/></li> <li>SIZE<input type="text" name="contNo2_1" id="contNo2_1" size="15" value=""/></li> <li>MODE<input type="text" name="contNo3_1" id="contNo3_1" size="15" value=""/></li> <li>PICES<input type="text" name="contNo4_1" id="contNo4_1" size="15" value=""/></li> <li>WEIGHT<input type="text" name="contNo5_1" id="contNo5_1" size="15" value=""/></li> <li>VOLUME<input type="text" name="contNo6_1" id="contNo6_1" size="15" value=""/></li> </ul> <input type='button' id='btnAdd' size="15" value='add another row' /><input type='button' id='btnDel' value='delete row' /> and here is my sql query <?php $con=mysqli_connect("localhost","root","1234","shipping"); // Check connection if (mysqli_connect_errno()) { mysqli_connect_error(); } $sql="INSERT INTO infobl (contNo_1, contNo2_1, contNo3_1, contNo4_1, contNo5_1, contNo6_1, contNo_2, contNo2_2, contNo3_2, contNo4_2, contNo5_2, contNo6_2, datetime) VALUES ('$_POST[contNo_1]','$_POST[contNo2_1]','$_POST[contNo3_1]','$_POST[contNo4_1]','$_POST[contNo5_1]','$_POST[contNo6_1]','$_POST[contNo_2]','$_POST[contNo2_2]','$_POST[contNo3_2]','$_POST[contNo4_2]','$_POST[contNo5_2]','$_POST[contNo6_2]',NOW())"; if (!mysqli_query($con,$sql)) { die('<font color="#FF0000"><h2>Error: ---PLEASE CHECK YOUR NUMBER AGAIN....<br />Press Back on the browser.... </h2></font>' . mysqli_error($con)) ; } else header('location: /bldrft/edits/view.php'); mysqli_close($con); ?> I can't figure it out what was the wrong, all are fine to me, plzz help guys. thanks.
  17. Hi, I have problem with this line var value = $("#opstina option:selected").val(); , but only in chrome i get that value is undefined. In FireFox, and IE, works fine, only in chrome i get this warning. Does someone know why? My whole jquery code is if ($("#drzava option:selected").length) { $("select#opstina").attr("disabled","disabled"); $("select#opstina").html("<option>wait...</option>"); var id = $("select#drzava option:selected").attr('value'); $.post("select_opstina.php", {id:id}, function(data){ $("select#opstina").removeAttr("disabled"); alert( "html koji bi trebao biti upisan u select:\n\n" + data ); $("select#opstina").html(data); }); if ($("#opstina option:selected").length) { alert('Došao sam pred petlju'); var value = $("#opstina option:selected").val();//this is line that is problem alert(value); var sel = $("#opstina").val(); // this do the same if (sel!=0) { alert('Ušao sam u petlju, i selektovano polje za opštinu je' + sel ); $("select#mesto").attr("disabled","disabled"); $("select#mesto").html("<option>wait...</option>"); var id= $("select#opstina option:selected").attr('value'); alert(id); $.post("select_mesto.php", {id:id}, function(data){ alert("html koji bi trebao biti upisan u select:\n\n" + data ); $("select#mesto").removeAttr("disabled"); $("select#mesto").html(data); }); } } } }
  18. Hi, I have a page like this <!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>Untitled Document</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script> <style> .add-another-cat { /*float:right; */ background-image:url(add_btn.png); width:18px; height:18px; } </style> <!-- for list --> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <style> #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; } #sortable li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; height: 1.5em; } html>body #sortable li { height: 1.5em; line-height: 1.2em; } .ui-state-highlight { height: 1.5em; line-height: 1.2em; } </style> <script> $(function() { $( "#sortable" ).sortable({ placeholder: "ui-state-highlight" }); $( "#sortable" ).disableSelection(); }); </script> </head> <body> <script language="javascript"> //<![CDATA[ $(window).load(function(){ $('.add-another-cat').click(function(event){ event.preventDefault(); var $orDiv = $('.new-category:last').after($('#clone').clone().removeAttr('id').show()); }); $('.new-categories').html($('#clone').clone().removeAttr('id').show()); });//]]> </script> <div id="clone" class="new-category" style="display:none;"> <select class="category-select" name="localprojects"> <option value="1">mca 1</option> <option value="2">mca 2</option> </select> <===> <select class="category-select" name="remoteprojects"> <option value="z1">zoho 1</option> <option value="z2">zoho 2</option> </select> <select class='category-select-sub' style="display:none"> <!-- loaded from ajax --> </select> </div> <div class="new-categories" style="display: inline-block;"> </div> <a href="#" class="add-another-cat smallest" style="display: inline-block;"></a> <ul id="sortable"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> <li class="ui-state-default">Item 3</li> <li class="ui-state-default">Item 4</li> <li class="ui-state-default">Item 5</li> <li class="ui-state-default">Item 6</li> <li class="ui-state-default">Item 7</li> </ul> </body> </html> I like to get the selected values from the 2 comboboxes, combine them together as a string and add to the list <ul id="sortable"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> <li class="ui-state-default">Item 3</li> <li class="ui-state-default">Item 4</li> <li class="ui-state-default">Item 5</li> <li class="ui-state-default">Item 6</li> <li class="ui-state-default">Item 7</li> </ul> For example: if user selects "mca 1" (value "1") and "zoho 2" (value "z2") then the following html code should be auto generated. <li class="ui-state-default" value="1-z2">mca 1 - zoho 2</li> Would you please tell me how to do this? Thanks.
  19. Hello all! I've written a jQuery addMethod for the jQuery validation plugin that seems to be causing an error. Basically this method just checks the db to see if the email address is registered. It works correctly and prompts the error/or passes it correctly. However it fired back an error and sets the focus to the field on submit. If I take this out, the form fires correctly no problem. Any insight I would appreciate. Submit Handler: submitHandler: function(form) { if($("#registerForm").valid()) { $.ajax({ type: "POST", async: false, url: "activate.php", data: $("#registerForm").serialize(), success: function(data) { $('#results').html(data); $('#registerForm').fadeOut(1000); $('#thanks').fadeToggle(1000); } }) } }, addMethod $.validator.addMethod("checkEmailAvailability", function(email) { $('#email').blur(function() { $.ajax({ type: "POST", url: "http://"+location.host+"/includes/checkemail.php?", data: "email=" +$("#email").val(), success: function(data) { if(data == 'false') { //$('#checkEmail').removeClass("validate-ok"); $('#checkEmail').addClass("validate-error").html('✗ ' + $("#email").val() + ' is already a registered email.'); } else { $('#checkEmail').html(''); } } }) }); });
  20. 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.
  21. 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!
  22. 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.
  23. 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?
  24. 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>
  25. 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?
×
×
  • 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.