Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. How to set the result variable of a javascript of one div to another div tag

How to set the result variable of a javascript of one div to another div tag

Scheduled Pinned Locked Moved Java
jsonjavascripthtmlsalestools
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11233847
    wrote on last edited by
    #1

    HTML PAGE:

    <label for="cust\_name">Name</label>
    <input id="cust\_name" type="text"/> 
    <label for="cust\_id">Customer-ID</label>
    <input id="cust\_id" type="text" />
    <label for="cust\_phone">Phone Number</label>
    <input id="cust\_phone" type="number" />
    <label for="cust\_add">Address</label>
    <input id="cust\_add" type="text" />
    <label for="cust\_issue">Issue</label>
    <input id="cust\_issue" type="text" />
    <label for="complaint\_date">Date of Complaint</label>
    <input id="complaint\_date" type="text" />
    
        
    
            
    
                 
    
                 [<input type="button" value="Show History" data-icon="back" data-iconpos="right" id="History" onClick()="getHistory()"/>](#historypage)
                  
    
                  
    
                  [<input type="button" value="Start Assessment" data-icon="check" data-iconpos="right" id="Assessment"/>](#assessmentpage)
    

    </form>

      <form id="historyForm">
          <label for="hist\_cname">Customer Name</label>
          input id="hist\_cname" type="text" />
          <label for="hist\_cid">CustomerID</label>
          <input id="hist\_cid" type="text" />
       </form>
    

    Here are the details

    '

    SCRIPT:

    function getHistory() {

    var cust\_id = document.getElementById("cust\_id");
    var myTable = '';
    myTable += '';
    myTable += "";
    var url = "http://localhost:8080/POS/rest/WebServices/getHistory/"+cust\_id.value;
    

    $.getJSON(url, function(json) {

       $.each(json, function(i, v) {
    
           myTable += "
    

    S.No.

    Date

    Time

    Complaint(s)

    " + v.date + "

    "+ v.time + "

    " + v.issue
    + "

    " ;
    });

    });

    what i have to do here is,when i clicked the bu

    L 1 Reply Last reply
    0
    • U User 11233847

      HTML PAGE:

      <label for="cust\_name">Name</label>
      <input id="cust\_name" type="text"/> 
      <label for="cust\_id">Customer-ID</label>
      <input id="cust\_id" type="text" />
      <label for="cust\_phone">Phone Number</label>
      <input id="cust\_phone" type="number" />
      <label for="cust\_add">Address</label>
      <input id="cust\_add" type="text" />
      <label for="cust\_issue">Issue</label>
      <input id="cust\_issue" type="text" />
      <label for="complaint\_date">Date of Complaint</label>
      <input id="complaint\_date" type="text" />
      
          
      
              
      
                   
      
                   [<input type="button" value="Show History" data-icon="back" data-iconpos="right" id="History" onClick()="getHistory()"/>](#historypage)
                    
      
                    
      
                    [<input type="button" value="Start Assessment" data-icon="check" data-iconpos="right" id="Assessment"/>](#assessmentpage)
      

      </form>

        <form id="historyForm">
            <label for="hist\_cname">Customer Name</label>
            input id="hist\_cname" type="text" />
            <label for="hist\_cid">CustomerID</label>
            <input id="hist\_cid" type="text" />
         </form>
      

      Here are the details

      '

      SCRIPT:

      function getHistory() {

      var cust\_id = document.getElementById("cust\_id");
      var myTable = '';
      myTable += '';
      myTable += "";
      var url = "http://localhost:8080/POS/rest/WebServices/getHistory/"+cust\_id.value;
      

      $.getJSON(url, function(json) {

         $.each(json, function(i, v) {
      
             myTable += "
      

      S.No.

      Date

      Time

      Complaint(s)

      " + v.date + "

      "+ v.time + "

      " + v.issue
      + "

      " ;
      });

      });

      what i have to do here is,when i clicked the bu

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This forum is for Java issues; the Javascript forum is http://www.codeproject.com/Forums/1580226/JavaScript.aspx[^].

      U 1 Reply Last reply
      0
      • L Lost User

        This forum is for Java issues; the Javascript forum is http://www.codeproject.com/Forums/1580226/JavaScript.aspx[^].

        U Offline
        U Offline
        User 11233847
        wrote on last edited by
        #3

        Oh sorry

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups