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.

Brock

Members
  • Joined

  • Last visited

  1.    remino reacted to a post in a topic: AJAX Form Submit
  2. Brock replied to Brock's topic in Frontend
    Oookay! (: If someone else knows if it's possible on the same page and how to do it I'd still be interested, but I'll separate the php for now. Thanks for the help!
  3.    Brock reacted to a post in a topic: AJAX Form Submit
  4. Brock replied to Brock's topic in Frontend
    Right, okay, could that be because my php is in the same page as the js? It's just at the top of the document, and the js is at the bottom. And the log has just returned the page source again
  5.    Brock reacted to a post in a topic: AJAX Form Submit
  6.    Brock reacted to a post in a topic: AJAX Form Submit
  7. Brock replied to Brock's topic in Frontend
    Thanks for the answer but it's still giving the same result. It's still just outputting the html source into the textarea. Anything else that could be causing this? This may help actually. I used to be doing it like this: <textarea type="text" id="myOutput" placeholder="Preview"><?php echo $message; ?> </textarea> It's specifically the message variable I want. This actually works, when I hit submit it shows the correct message value in the textarea. I was just trying to get it to do it without the page refresh.
  8. Brock posted a topic in Frontend
    I'm trying to get this form to submit and post all the data to a text area without a page refresh. The form works fine, but since adding the js, when I hit submit it just copies a few blank lines into to the textarea. I've tried to debug this and used: $(document).ready(function () { $('#myForm').on('submit', function(e) { e.preventDefault(); $.ajax({ url : $(this).attr('action') || window.location.pathname, type: "GET", data: $(this).serialize(), success: function (data) { //tried this to debug alert(data); }, error: function (jXHR, textStatus, errorThrown) { alert(errorThrown); } }); }); }); And this just returns the full source of the document. Not sure why, any ideas? Full source below. PHP <?php if(!empty($_POST["project"])) { $description = Trim(stripslashes($_POST["description"])); $array = $_POST["data"]; $subtotal = Trim(stripslashes($_POST["subtotal"])); $discount = Trim(stripslashes($_POST["discount"])); $total = Trim(stripslashes($_POST["total"])); $time = Trim(stripslashes($_POST["time"])); $Organisation = Trim(stripslashes($_POST["Organisation"])); $full = Trim(stripslashes($_POST["full"])); $first = Trim(stripslashes($_POST["first"])); $email = Trim(stripslashes($_POST["email"])); $n1 = "\r\n"; $n2 = "\r\n\r\n"; $message = "Hello"; } ?> JS $(document).ready(function () { $('#myForm').on('submit', function(e) { e.preventDefault(); $.ajax({ url : $(this).attr('action') || window.location.pathname, type: "GET", data: $(this).serialize(), success: function (data) { $("#myOutput").html(data); }, error: function (jXHR, textStatus, errorThrown) { alert(errorThrown); } }); }); }); HTML <form id="myForm" method="post"> <input name="project" type="submit" value="OK"> </form> <textarea type="text" id="myOutput"></textarea>
  9.    NOCK reacted to a post in a topic: Directory Delete Blank Page
  10. Oookay! Yes it was an issue with the returns. They did confuse me a little when I first found the script but everyone else using it said it worked. This works for me: chmod("1", 0777); chmod("1/images", 0777); chmod("1/scripts", 0777); chmod("1/uploads", 0777); $path = "1"; if (is_dir($path) === true) { $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path) , RecursiveIteratorIterator::CHILD_FIRST); foreach($files as $file) { if (in_array($file->getBasename() , array( '.', '..' )) !== true) { if ($file->isDir() === true) { rmdir($file->getPathName()); } else if (($file->isFile() === true) || ($file->isLink() === true)) { unlink($file->getPathname()); } } } rmdir($path); } else if ((is_file($path) === true) || (is_link($path) === true)) { unlink($path); } Basically removed the returns and removed the end return false. Pretty sure this is fine now but if you can see any issues please let me know, but if not thanks for the help Nock! (:
  11. Well, all my php scripts always return to the page I was on after running, so that's what I wanted it to do ideally. I just thought there was something wrong with the script because it was sticking on a white screen. Regarding the echo, I actually tried that. Here's what I get with an echo: If the script finds and delets the folder: Blank page If the script doesn't find the folder: Warning: chmod(): No such file or directory in /home/domain/public_html/clients/index.php on line 95 Warning: chmod(): No such file or directory in /home/domain/public_html/clients/index.php on line 96 Warning: chmod(): No such file or directory in /home/domain/public_html/clients/index.php on line 97 Warning: chmod(): No such file or directory in /home/domain/public_html/clients/index.php on line 98 all done So the script returns as usual if the script fails, but if it works it stick on a blank page?
  12. I have this script which copies files from an existing folder (client) to a new folder (1). $root = __DIR__; mkdir("$root/1",0755,true); $source = "$root/client"; $dest= "$root/1"; foreach ( $iterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($source,\RecursiveDirectoryIterator::SKIP_DOTS),\RecursiveIteratorIterator::SELF_FIRST) as $item) { if ($item->isDir()) { mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); } else { copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); } } I am then deleting that new folder with this: //chmod The folders from 755 to 777 ready to delete chmod("1", 0777); chmod("1/images", 0777); chmod("1/scripts", 0777); chmod("1/uploads", 0777); //Set Path to directory to be deleted $path = "1"; //Delete Directory if (is_dir($path) === true) { $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path) , RecursiveIteratorIterator::CHILD_FIRST); foreach($files as $file) { if (in_array($file->getBasename() , array( '.', '..' )) !== true) { if ($file->isDir() === true) { rmdir($file->getPathName()); } else if (($file->isFile() === true) || ($file->isLink() === true)) { unlink($file->getPathname()); } } } return rmdir($path); } else if ((is_file($path) === true) || (is_link($path) === true)) { return unlink($path); } return false; The script works, however once the scripts been run it sticks at a white page. I've tried all sorts of error reporting and they all show nothing, there are also no error logs. Wondered if anyone had any idea why?
  13.    Brock reacted to a post in a topic: Add row beneath clicked row dynamic form
  14. var cols = ""; $(document).on('click', '.addButton', function(e){ var newRow = row.clone(); var regex = new RegExp("data\[[0-9]+\]", "g"); newRow.html(newRow.html().replace(regex, "data[" + (++count) + "]")); newRow.append(cols); newRow.insertAfter( $(this).closest("tr") ); }); That did it, not sure what the cols bit is doing exactly but it works (: heh. Thanks once again Drama Queen!
  15. Sorry, actually on testing it it's not quite what I was after, what I'm looking for is more of an insert feature. I've actually just found a jsfiddle with what I'm after in, so I'm trying to figure out how to get it into mine! http://jsfiddle.net/rplantiko/cDa3N/ Pretty sure it's these I'm after: newRow.append(cols); newRow.insertAfter( $(this).closest("tr") );
  16. Yeeess! That's it, was trying all sorts yours seems so simple x) heh. Thanks for the help, greatly appreciated Drama Queen!
  17.    Brock reacted to a post in a topic: Add row beneath clicked row dynamic form
  18. Ahhh, I see! thanks a lot for the help! Still not sure about the how to get it underneath kinda thing but I'll go see if I can figure it out (: Thankyou (:
  19. Anyone know anything about this? Really struggling to figure this out
  20. Hey guys, I'm trying to get this "add row" button to add a row under the one that's clicked.So: Click "add row" > Adds a row beneath which ever button was clicked. At the moment the top button is the only one that will add a row, and it adds it to the bttom of all the rows. Here's a jsfiddle of what I mean. http://jsfiddle.net/re2af/194/ Does anyone know how to achieve this?
  21.    Brock reacted to a post in a topic: Form rows not deleting
  22. Brock replied to Brock's topic in Frontend
    http://jsfiddle.net/re2af/190/ I've done it like that for now, there must be a better way though? Sorry, forgot to update links, this one works, but I'm sure there's a better way then to do the whole function again.
  23. Brock replied to Brock's topic in Frontend
    http://jsfiddle.net/re2af/189/ Deletes working, just wondering how to update the price after a rows been deleted?

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.