User Profile

Collapse

Profile Sidebar

Collapse
Sherin
Sherin
Last Activity: Mar 9 '21, 09:02 AM
Joined: Jan 6 '20
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hello!
    I hope solution is helpful for you.
    Code:
    .responsive {
      width: 100%;
      height: auto;
    }
    
    <img src="img.jpg" alt="image" class="responsive">
    See more | Go to post

    Leave a comment:


  • Try This Code

    Code:
    <div id="bikeDiv">
    </div>
    <button id="addbikeBtn">Add Bike</button>
    <script>
    var current = 0;
    var cars = new Array(4);
    cars[0] = "TVS";
    cars[1] = "Yamaha";
    cars[2] = "Royal Enfield";
    cars[3] = "Bajaj Pulsar";
    document.getElementById("addbikeBtn").onclick
    ...
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to What is the call by value in function?
    in C
    The call by value the actual arguments are copied to the formal arguments, hence any operation performed by function on arguments doesn’t affect actual parameters. Lets take an example to understand this:

    Code:
    #include <stdio.h>
    int increment(int var)
    {
        var = var+1;
        return var;
    }
    
    int main()
    {
       int num1=10;
       int num2 = increment(num1);
       printf("num1
    ...
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to how to return value from ajax function?
    Try This code

    Code:
    function cityconfirm()
    {
    var cityid=document.getElementById('city').value;
    alert(getcityvalue(cityid));
    return confirm('Are you sure you want to delete')
    }
    
    function getcityvalue(cityid)
    
    {
    
    jQuery.ajax({
    url: 'http://mysite.com/lookupcity.asp?cityid=' + cityid,
    type: 'get',
    dataType: 'text/html',
    success:function(data)
    ...
    See more | Go to post

    Leave a comment:


  • Try This Code

    Code:
    var min = 10,
        max = 50,
        select = document.getElementById('selectElementId');
    
    for (var i = min; i<=max; i++){
        var opt = document.createElement('option');
        opt.value = i;
        opt.innerHTML = i;
        select.appendChild(opt);
    }
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to How do I create a user defined array size?
    in Java
    Try This Code

    Code:
    import java.util.Arrays;
    import java.util.Scanner;
    
    public class PopulatingAnArray {
       public static void main(String args[]) {
          System.out.println("Enter the required size of the array :: ");
          Scanner s = new Scanner(System.in);
          int size = s.nextInt();
          int myArray[] = new int [size];
          System.out.println("Enter the
    ...
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to how to restart in java japplet?
    in Java
    That's because you can't init() again after the applet has stopped. There is nothing to call the method.

    Why don't you create a reset() method that gives default values to your variables etc and makes it seem like the applet has restarted?
    See more | Go to post

    Leave a comment:


  • Try This Code

    Code:
    function playAudio (src) {
        if(window.audio) {
           audio.pause();
        }
        window.audio = new Audio (src);
        window.audio.play();
    }
    now all you need to do is to call it when you click on a link:

    Code:
    <tag onclick="playAudio('/link/to/audio.mp3')"> Click Me </tag>
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to How to Print Binary of a Decimal Number
    in Java
    Try This Code

    Code:
    public class BinaryDecimal {
    
        public static void main(String[] args) {
            long num = 110110111;
            int decimal = convertBinaryToDecimal(num);
            System.out.printf("%d in binary = %d in decimal", num, decimal);
        }
    
        public static int convertBinaryToDecimal(long num)
        {
            int decimalNumber = 0, i = 0;
    ...
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to why use namespace std?
    in C
    A namespace is designed to overcome this difficulty and is used as additional information to differentiate similar functions, classes, variables etc. with the same name available in different libraries. Using namespace, you can define the context in which names are defined. In essence, a namespace defines a scope.
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to How to create 4 dimensional array
    in C
    Try This Code

    Code:
    #include <stdio.h> 
    int main() 
    { 
    	
    	int i, j, k, l, size; 
    
    	int a[2][2][2][2]; 
    
    	size = 2; 
    
    	a[0][0][0][0] = 5; 
    	a[0][0][0][1] = 3; 
    	a[0][0][1][0] = 5; 
    	a[0][0][1][1] = 3; 
    	a[0][1][0][0] = 6; 
    	a[0][1][0][1] = 7; 
    	a[0][1][1][0] = 6; 
    	a[0][1][1][1] = 7; 
    	a[1][0][0][0]
    ...
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to how to hide unchecked row in table
    Try This Code

    Code:
    $("button").click(function(){
        $("table tr").has(".check-box:not(:checked)").hide();
    });
    table, tr, td {
        border: 1px solid black;
    }
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <table>
        <tr>
            <th>Name</th>
    ...
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to How to validate a form using if statements
    in PHP
    Try This Code

    Code:
     function checkExpire(form)
      {
        // regular expression to match required date format
        re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
    
    if(form.txtExpire.value != '' && !form.txtExpire.value.match(re)) {
      alert("Invalid date format: " + form.txtExpire.value);
      form.txtExpire.focus();
      return false;
    } 
    
    return true;
      }
    See more | Go to post

    Leave a comment:


  • Code:
    <html>
      <head>
    
      function ValidateForm(form){
      ErrorText= "";
      if ( ( form.gender[0].checked == false ) && ( form.gender[1].checked == false ) ) 
      {
      alert ( "Please choose your Gender: Male or Female" ); 
      return false;
      }
      if (ErrorText= "") { form.submit() }
      }
     
     </head>
      <body>
    ...
    See more | Go to post

    Leave a comment:


  • Try This Code

    Code:
    #include <bits/stdc++.h> 
    using namespace std; 
    
    bool isChar(char c) 
    { 
    	return ((c >= 'a' && c <= 'z') 
    			|| (c >= 'A' && c <= 'Z')); 
    } 
    
    bool isDigit(const char c) 
    { 
    	return (c >= '0' && c <= '9'); 
    } 
    
    bool is_valid(string email) 
    { 
    	
    	if (!isChar(email[0]))
    ...
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to Background image slideshow rogue image
    Try This

    Code:
    <script>
    var slideIndex = 1;
    showSlides(slideIndex);
    
    function plusSlides(n) {
      showSlides(slideIndex += n);
    }
    
    function currentSlide(n) {
      showSlides(slideIndex = n);
    }
    
    function showSlides(n) {
      var i;
      var slides = document.getElementsByClassName("mySlides");
      var dots = document.getElementsByClassName("dot");
    ...
    See more | Go to post

    Leave a comment:


  • A compile error happens when the compiler reports something wrong with your program, and does not produce a machine-language translation. You will get compile errors. Everybody does. Don't let them bother you. They are usually relatively easy to fix.

    If you request warnings, the compiler will also warn you when it sees something that does not look right. A program that only has warnings will be translated to machine language, but you...
    See more | Go to post

    Leave a comment:


  • Try This Code

    Code:
    using System;
    using System.Web.UI.WebControls;
    using System.Data;
    
    namespace WebFormDemo
    {
        public partial class DynamicControlInGridView : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e) {
                if (!IsPostBack)
                    BindGridView();
            }
    
            protected void GridView1_RowCreated(object
    ...
    See more | Go to post

    Leave a comment:


  • I created a code which gives me yyyymm dynamically upto current year month..

    Code:
    function dropdown(monthfield, yearfield){
                   var monthtext=['01','02','03','04','05','06','07','08','09','10','11','12'];
                   var today=new Date()
                   var monthfield=document.getElementById(monthfield)
                   var yearfield=document.getElementById(yearfield)
                   var thisyear=today.getFullYear()
    ...
    See more | Go to post

    Leave a comment:


  • Sherin
    replied to how to add close button tab header.
    Try This Code

    Code:
    <html lang="en">
    <head>
      <meta charset="utf-8" />
      <title>jQuery UI Tabs - Default functionality</title>
      <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
      <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
      <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...