Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php input onchange

/*
You can't execute PHP in the browser.
Do an AJAX call or POST to a PHP function on the web server, 
or write a Javascript function that executes in the browser.
*/

// html
<input name="file" onchange="mainInfo(this.value);"
// AJAX
function mainInfo(id) {
    $.ajax({
        type: "GET",
        url: "mypage.php",
        data: "mainid =" + id,
        success: function(result) {
            $("#somewhere").html(result);
        }
    });
};

// php
<?php
    if(isset($_GET['mainid'])){
        mainInfo($_GET['mainid']);
    }
?>
Comment

PREVIOUS NEXT
Code Example
Php :: php to print array value if key exists 
Php :: php try catch non object 
Php :: php strict mopde 
Php :: Clear any previous error php 
Php :: match uuid patter laravel regex 
Php :: laravel migration smallint length 
Php :: laravel create custom route file 
Php :: magento 2 colllection set select 
Php :: Show All Categories as Links 
Php :: best custom email validation rule for laravel 
Php :: trova corrispondenza nella stringa php 
Php :: laravel collection makeHidden 
Php :: create config value file in php 
Php :: laravel eloquent get x number of results 
Php :: php filter_var name 
Php :: change wordpress viewport 
Php :: woocommerce php reset password length 
Php :: You are *required* to use the date.timezone setting or t 
Php :: close route in laravel 
Php :: is search page wordpress dev 
Php :: morph relation laravel 
Php :: create file in directory php 
Php :: switching between php versions 
Php :: laravel repository update multiple row 
Php :: php function return multiple values 
Php :: docker php-fpm-apline add imagick 
Php :: laravel schedule kernel code sample 
Php :: laravel how to check app env 
Php :: php keep input value after submit 
Php :: php website templates free download with database 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =