Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Meh

Members
  • Joined

  • Last visited

  1. Meh replied to Meh's topic in Frontend
    Brilliant, thankyou (:
  2.    Meh reacted to a post in a topic: TD Input check
  3. Meh posted a topic in Frontend
    Trying to get this script to do this: if any of the td text inputs are empty in this tr do this else so something else. My Table <table id="project"> <tbody> <tr> <td><input type="button" value="×" class="delete"></td> <td><input type="button" value="∧" class="move up" ></td> <td><input type="button" value="∨" class="move down"></td> <td><input name="data[0][0]" data-field="description" placeholder="Description" required size="40"></td> <td><input name="data[0][1]" data-field="quantity" placeholder="Q" size="1" required></td> <td><input name="data[0][2]" data-field="price" placeholder="P" size="7" required></td> <td><input name="data[0][3]" data-field="total" placeholder="T" size="7" readonly required></td> <td><input type="button" value="&plus;" class="add"></td> </tr> </tbody> </table> My JS if ($('input:text').val().length == 0) { alert("empty") }else{ alert("Not empty") } This kind of works, if I use this it will display "empty" if they are all empty, but if i input text into just one of them then it goes to the else. Anyone know how this could work?
  4. Ahh okay! Brilliant! Thankyou (:
  5.    Meh reacted to a post in a topic: Can these functions be combined?
  6. $(document).on('keyup', "*[data-field='quantity'],*[data-field='price']", function(e){ $(document).on('click', ".calculate, .delete", function(e){ They do the same thing, but I'm just wondering if these can be combined?
  7. Hey, is there any way to get this: $(document).on('keyup', "*[data-field='quantity'],*[data-field='price']", function(e){ to run whenever there's a change the whole table? At the moment it only changes on the keyup in the [data-field=quantity] and [data-field=price] as it says. But thing is I have a button to delete a row, and once ones deleted it doesn't update the total. To see what I mean go here: http://jsfiddle.net/re2af/195/ And add like two rows and watch it add up the totals, then delete one. The total doesn't update until there's another change in the [data-field=quantity] and [data-field=price] inputs. I also have a button which will add prefilled data into this table, so I kind of need that line above to run whenever there's a change in the table. I have tried all sorts (on change, on blur, on click etc...), this came close: $("#mytable").bind("DOMSubtreeModified", function() { alert("Hurrey table changed"); }); As it would alert when there was a change, but I couldn't get it to work with the form in the jsfiddle.
  8. Doesn't matter. think this is a PHP issue.
  9. Hey guys, I have setup a table with dynamic rows (a kind of price calculator). You can click a button to insert a row, and there's a button to delete a row. See link below for example of the kinda thing I'm talking about. Insert row after current row - JSFiddle Once the tables filled in, I then post it to some PHP and it sends the information out in an email. However, inserted rows are always put at the bottom of the table when it's displayed in the email, regardless of where they were inserted in filling out the form. An example: Lets say I have filled out two rows on my webpage, like so: item1 quantity amount total item2 quantity amount total But now I realise I need to put something inbetween them. item1 quantity amount total item3 quantity amount total << I've inserted this row item2 quantity amount total If i post this via php, it will display like this: item1 quantity amount total item2 quantity amount total item3 quantity amount total << It's at the bottom When It should display like this: item1 quantity amount total item3 quantity amount total << Should be here where I inserted it item2 quantity amount total# MY table: <table id="TextBoxesGroup"> <tbody> <tr> <td> <input type="button" class="deleteDep" value="Delete" /></td> <td><input name="data[0][0]" placeholder="Item Description"></td> <td><input data-field="quantity" name="data[0][1]" placeholder="Item Quantity" ></td> <td><input data-field="price" name="data[0][2]" placeholder="Item Amount"></td> <td><input data-field="total" name="data[0][3]" placeholder="Item Total" readonly="readonly"></td> <td><input type="button" class="addButton" value=" Add Row "></td> </tr> </tbody> </table> My javascript $(window).load(function() { $(document).ready(function() { var table = $("#TextBoxesGroup"); var row = table.find("tr var count = 0; var cols = ""; //Here is my add function $(document).on('click', '.addButton', function(e) { var newRow = row.clone(); var regex = new RegExp("data\[[0-9]+\]", "g"); //I thin the issue is something to do with this llne newRow.html(newRow.html().replace(regex, "data[" + (++count) + "]")); newRow.append(cols); newRow.insertAfter($(this).closest("tr")); }); //Here is my delete function $('body').on('click', 'input.deleteDep', function(e) { if (table.find("tr").length return; } $(this).parents('tr').remove(); }); //This is to calculate the totals $(document).on('keyup', "*[data-field='quantity'],*[data-field='price']", function(e) { var thisRow = $(this).parents("tr:first"); var rowTotalField = thisRow.find("*[data-field='total']"); var price = parseFloat(thisRow.find("*[data-field='price']").val()); var quantity = parseInt(thisRow.find("*[data-field='quantity']").val()); rowTotalField.val((!isNaN(price) && !isNaN(quantity) ? price * quantity : 0).toFixed(2)); var total = 0; table.find("*[data-field='total']").each(function() { var t = parseFloat($(this).val().replace("£", "")); total += !isNaN(t) ? t : 0; }); $('#total').val(total.toFixed(2)); }); }); }); I know it's something to do with the count of the data for the array, but Im not sure how to fix it. Any ideas? If there's anyway to just submit it to the php in the order it's in in the html that'd be better, as I have a delete function which I think also messes with the count and screws up the data. Just so you know though, my PHP uses this: function StringifyCartArray($aArr) { return $aArr[0] . " ( " . $aArr[1] . " x £" . $aArr[2] . " ) £" . $aArr[3] . " <br>" ; } for ($Lup = 0; $Lup < sizeof($data); $Lup++) $message .= StringifyCartArray($data[$Lup]); I'm not sure if this is relevant, but just thought id share how the php was using these variables. Thanks for any help (:
  10.    Meh reacted to a post in a topic: Image height issue with fluid images
  11.    Meh reacted to a post in a topic: Image height issue with fluid images
  12.    Meh reacted to a post in a topic: Image height issue with fluid images
  13.    Meh reacted to a post in a topic: Image height issue with fluid images
  14.    Meh reacted to a post in a topic: Image height issue with fluid images
  15.    Meh reacted to a post in a topic: Image height issue with fluid images
  16. Yeah I figured as much. Cheers for the help anyway, appreciate it. I'll check out some javascript solutons tomorrow.
  17. I've actually tried that and can't get any sort of measurement to line up. The last link I posted: http://jsfiddle.net/fCnhP/ Shows it without images and working off measurements - but it still varies the heights when shrunk down. Not sure if it's going to be possible using this method to be honest. I don't suppose you (or anyone) knows any better ways of achieving this?
  18. Think you're still looking at the old fiddle I first posted. I took the queries out in the latest version so the different in height was more clear.
  19. Sorry, but I don't suppose anyknow knows if the aspect ratios have to be exactly the same for this to work? Here's an example of rbrsmitsh method, but the divs still aren't lining up when shrunk. Is it the padding that's causing the issues maybe? http://jsfiddle.net/fCnhP/
  20. Cheers for that, it seems the images are now sticking to the container, but the div that holds the image isn't sticking to the height of the entire row, maybe due to the two images to the left pushing it all down a little? (only noticeable at a little before the 480px width mark). http://jsfiddle.net/jF38E/
  21. Sorry, posted a link to one of the images by accident. See here. http://jsfiddle.net/jF38E/ Cheers for the answer, however my heights are currently based off images so nothing has a fixed height - that's kind of the main part of the issue. Any ideas how to do this with my current setup? I don't mind altering it if there's an easier way, just so long as the end results the same.
  22. Hey guys, http://i60.tinypic.com/24v7dxl.jpg I have this fluid grid set up that splits into single images at 480px. It works fine but if you drag the window down to just before the 480 mark you'll see the larger image not stick to the full height of the container. I've read a lot on getting divs to stick to the height of the containers, but I cannot seem to find a solution that works with this current set up.
  23. Hey By default Magnific Popup has titles with images and not modals. I'm wondering if anyone knows how I could turn on titles with a modal. http://dimsemenov.com/plugins/magnific-popup/ If you view an image popup, you'll see the title in the bottom left. Whereas if you view the modal, it's not active. I've viewed the docs and there's nothing there concerning this. $(document).ready(function(){$(".open-popup-link").magnificPopup({type:"inline",midClick:true})}) This is the line I'm using to initialise the popup.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.