I am trying to implement a feature which goes something like this: If textarea has content (not empty) and no attachment is added, then just display the message in the div. If textarea is empty, but an attachment is added, then display download button, which will force the message receiver to save the attachment to local disk. If textarea is
Tag: php
Pass javascript variable to twig
I just want to pass a javascript variable to a twig path. Now i’m using this, but it doesn’t work. Answer Note You should really look at the FOSJsRoutingBundle.
How to execute Linux command using client/server architecture [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question What I want here is a client logging in my website and can execute any Linux command. What is the
PHP/JavaScript random number
I am playing around with JavaScript and trying to choose some random images. What I’m actually trying to do: I have $totalsixes = rand(1,6); in PHP, and let’s say that chose 4. Then in JavaScript I want to show 4 images with the number 6 and 2 others with random numbers from 1-5. Here’s what I’ve tried so far: as
DropzoneJS & Laravel – Output form validation errors
I am trying to output form validation errors when you hover over the “X” in the dropped off file in Dropzone. What I get: How can I make the object Object output the actual error message from the form validation? I can alert the error message but can’t actually show the error message upon hovering over the x. My js
After the user clicks submit, the page goes to the php file. How can it remain on the HTML file and submit the form information to the email?
I am a beginner at PHP and was working on a contact form. After selecting the submit button, the response message is not shown. The page goes to the PHP file and the email is never sent. Also, none of the error messages appear. I am using validate.js and Jquery form.js. Here is a reference link:http://www.tutwow.com/htmlcss/create-a-simple-and-secure-contact-form-with-jquery-and-php/ The style of the
How do I refresh a DIV content?
I am trying to refresh a certain div within a bunch of divs. The div content is basically generated by PHP along with data from a MySQL database in addition to many variables being sent with the help of an XMLHttpRequest. The idea is to reload/refresh the div itself and not load a php file or to overwrite it with
Laravel 5 Validation – Return as json / ajax
I am trying to post the values into validation and return the response as json rather than return view as given in the documentation. The post is made by ajax so I need to receive the response in the ajax as well. I figured out that in order to prevent refresh of the page in the returning response, I have
Javascript image upload and display
My basic task is select image and display it,without saving it in database. For this 1.I have made a select tag in html,through which I can upload the image. 2.I have made a blank image tag in which at there is no image source,alternate is upload image. 3.select tag has onchange javascript event handler which calls javascript function changeimage. In
Convert PHP string to javascript string [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question For example, I have this php string: “2015-06-26”. I want to assign it to a javascript var. I tried with String(“2015-06-26”), but it’s substracting the