Posts

Showing posts with the label jquery

File size and file type finding in js(javascript)

Image
    < script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" > </ script > < form action = "upload.php" enctype = "multipart/form-data" method = "POST" id = "uploadform" > < input id = "openFile" name = "img" type = "file" /> </ form >   <script> $( document ).ready( function ( ) { $( '#openFile' ).on( 'change' , function ( evt ) { console .log( this .files[ 0 ].size); ///File size      var filename=   this .files[ 0 ];      extension = filename.split( '/' ).pop();    // File Type Extension       }); });   </script>    ------------------------------------------------------------------------------- <form id="form1" runat="server"> <input type='file' id="imgInp" /> <img id="blah" src="#" alt="your image...

Create json data and use it as dynamic data using jquery in Hindi | Codi...

Image

Set value in radio button by its name

Image
  function RadionButtonSelectedValueSet ( name, SelectdValue ) { $( 'input[name="' + name+ '"][value="' + SelectdValue + '"]' ).prop( 'checked' , true ); }

checkbox and radio button value

Image
  $("input[name=rate]:checked").val();

Indian Mobile No. Validation using Javascript and Jquery

Image
  Type 1 Validation using Javascript : - <!DOCTYPE html> <html> <head>     <title>Indian Mobile No. Validation</title> </head> <body> <h1 style="text-align:center">Indian Mobile No. Validation</h1> <form>     <table align="center" border="30">              <tr>             <td>Mobile No.</td>             <td><input type="text" id="mobile" maxlength="10"  placeholder="Enter Your Mobile No."  /></td>         </tr>                  <tr>             <td colspan="2">                 <input type="button"...

How to get URL data in Codeigniter

Image
  This is the example for it  :-  http://websitename.com/controller_name/function_name/parameter1/parameter2/parameter3 it will return $this ->uri->segment( 1 ); // controller $this ->uri->segment( 2 ); // function To get parameter1 in codeigniter : - $this->uri->segment(3); To get parameter2 in codeigniter : - $this->uri->segment(4);  To get parameter3 in codeigniter : - $this->uri->segment(5);  

How can I refresh a form JQuery

Image
   Do you have this? < form id = "form" > ..... </ form > If you do, it should work.   $( "#form" )[ 0 ].reset();   If you don't have an "id" for your form tag, you should use    < form > ..... </ form > $( "form" )[ 0 ].reset();  

How to take photo from mobile camera and upload it using php ?

 First we write front end code : - <!DOCTYPE html> <html> <head>     <title>jQM input file capture</title>     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" />     <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>     <script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script> </head> <body>     <div data-role="page" id="page">         <style>             #preview {                 width: 80%; max-width: 300px;             }         ...

How to take photo from camera and its preview in Jquery Mobile ?

 Here you will get code for preview of image captured by your device.   <!DOCTYPE html> <html> <head>     <title>jQM input file capture</title>     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" />     <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>     <script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script> </head> <body>     <div data-role="page" id="page">         <style>             #preview {                 width: 80%; max-width: 300px;             ...