Posts

Showing posts from December, 2015

Change Javascript variable image source based on radio button selection

Image
<html><head>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <title> - jsFiddle demo</title>         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>         <link rel="stylesheet" type="text/css" href="/css/result-light.css">     <style type="text/css">       </style>   <script type="text/javascript">//<![CDATA[ $(window).load(function(){ $('.radio').on({     'click': function(){         console.log($(this).val());         var image_url=$(this).val();         $('#my_image').attr('src',image_url);     } }); });//]]> </script> </head> <body>    <img id="my_image" src="http://i.imgur.com/tL6nW.gif" alt="">      <br> <input class="radio" name="radio" value=&

jquery get the image of radio button

Image
<html><head>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <title> - jsFiddle demo</title>         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>         <link rel="stylesheet" type="text/css" href="/css/result-light.css">     <style type="text/css">       </style>   <script type="text/javascript">//<![CDATA[ $(window).load(function(){ $('.radio').on({     'click': function(){         console.log($(this).val());         var image_url=$(this).val();         $('#my_image').attr('src',image_url);     } }); });//]]> </script> </head> <body>    <img id="my_image" src="http://i.imgur.com/tL6nW.gif" alt="">      <br> <input class="radio" name="radio" value=&

jquery get value of selected radio button

var resfront=$('input[name="front"]:checked').val(); $ ( 'input[name=radioName]:checked' , '#myForm' ). val ()

show data from database in new page based on id using php/ mysql

Image
firstpage.php   <?php $servername="localhost"; $username="root"; $password=""; $database="db"; //create connection$ $conn=new mysqli($servername, $username, $password, $database); //check connection if ($conn->connect_error) {     die("connection failed: ".$conn->connect_error); } $query = mysqli_query($conn,"select * from dress"); while ($row = mysqli_fetch_array($query)) { echo "<b><a href=\"detail.php?id={$row['OMDR_ID']}\">{$row['OMDR_NAME']}</a></b>"; echo "<br />"; } ?> detail.php <html> <head> <title>get data detail</title></head> <body> <?php $servername="localhost"; $username="root"; $password=""; $database="db"; //create connection$ $conn=new mysqli($servername, $username, $password, $database); //check c

jquery to check if radio option is selected

if ($('input[name="front"]:checked').length == 0){               erros = 1;     }     else {            }