Questions tagged as 'javascript'

1
answer

Call PHP function onClick HTML button

I want to call a PHP function that I have on the same page, in the HTML button. My PHP function: if(isset($_POST['insert'])) { insert(); } function insert() { $requete = "INSERT INTO \"event\" ( title,...
asked by 22.10.2014 / 15:51
2
answers

Detect when a form is sent

How can I detect when a form is submitted with pure Javascript? It would be the equivalent of this in jQuery $('#form').submit(function(event){ alert('Meu callback'); event.preventDefault(); }); I was detecting when the user clicked on...
asked by 11.08.2014 / 00:24
2
answers

Crop image with JS

You can use JCrop or some other library to crop image, but I set a default size? Who can just move the square over the image? I tried to use JCrop but the user is the one who defines the size that wants to crop the image.     
asked by 14.06.2014 / 17:37
3
answers

Is there a limit or restriction on variable name sizes?

When I started programming it was said to be a good practice to abbreviate variable names to shorten their size. However, I have been researching and seeing recently that this concept has changed. And today in many tutorials the examples come...
asked by 22.08.2016 / 15:28
4
answers

Loop run every 20 lines

I would like every button click to count, and it would invoke variavel to change the initialization and condition > for , for a numeric value of 20 in 20 . It would be kind to go from 0 to 20 and wait another click. On a...
asked by 05.05.2016 / 17:12
2
answers

How to put a phrase inside a form field and it disappear when clicking inside the field?

I would like to know how to put a phrase inside a form field, and it disappears when you click inside the field. Can it be in CSS? What do you do this for?     
asked by 10.12.2015 / 15:49
2
answers

Use or not use CSS / JS within PHP?

Using CSS / JS within PHP, is there a difference if used in an external file for example? Many pages have CSS / JS inside and also externally, would not it be easier to put all together than splitting one part in code and another externally on t...
asked by 10.06.2014 / 23:37
3
answers

Count of occurrences in a String

As I write a function that receives a
asked by 12.12.2015 / 16:49
2
answers

Two buttons to perform the same function?

I would like to click on two different buttons to perform the same function by changing only one value. In the code below I can execute the function by clicking the first button, but when I click on the second one it does not execute. How can...
asked by 30.04.2014 / 17:08
2
answers

How to insert a set time into a function

The function of this code below and after I click on a submit of a form it redirects to another page this works now only need it only redirects to another page after, 5 seconds someone knows how to do this very little javascript handling? $(...
asked by 16.01.2017 / 23:42