Click here to Skip to main content
15,879,326 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: postback issue when using dynamically created datetimepicker using javascript Pin
Anurag Gandhi5-Dec-14 5:29
professionalAnurag Gandhi5-Dec-14 5:29 
QuestionTranslation UserScript Pin
Kyudos3-Dec-14 11:20
Kyudos3-Dec-14 11:20 
AnswerRe: Translation UserScript Pin
Garth J Lancaster3-Dec-14 12:45
professionalGarth J Lancaster3-Dec-14 12:45 
GeneralRe: Translation UserScript Pin
Kyudos3-Dec-14 13:39
Kyudos3-Dec-14 13:39 
QuestionHow to use Gride View Pin
Member 112816092-Dec-14 17:25
Member 112816092-Dec-14 17:25 
AnswerRe: How to use Gride View Pin
den2k882-Dec-14 21:30
professionalden2k882-Dec-14 21:30 
QuestionDataTable.js problem with mozilla Pin
Hemant Thaker28-Nov-14 0:03
Hemant Thaker28-Nov-14 0:03 
QuestionHow to set the result variable of a javascript of one div to another div tag Pin
Member 1126811126-Nov-14 23:08
Member 1126811126-Nov-14 23:08 
HTML PAGE:

HTML
<form id="detailsform">
    <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" />
    <!--<label for="appt_date">Date of Appointment</label>
    <input id="appt_date" type="text" />-->
        <table align="center" width="100%">
            <tr>
                 <td align="left" width="35%"><a href="#historypage" style="text-                decoration:none">
                 <input type="button" value="Show History" data-icon="back" data-iconpos="right" id="History" onClick()="getHistory()"/>
                  </a></td>
                  <td align="right" width="35%"><a href="#assessmentpage" style="text-decoration:none">
                  <input type="button" value="Start Assessment" data-icon="check" data-iconpos="right" id="Assessment"/>
                   </a></td>
             </tr>
      </table>
</form>

<div data-role="page" id="historypage" data-theme="f">

   <div data-role="content">
      <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>

   <div id="emp_tb1" align="center" data-theme="b">Here are the details </div>
</div>


Script page:
JavaScript
function getHistory() {

    var cust_id = document.getElementById("cust_id");
    var myTable = '';
    myTable += '<table id="myTable" cellspacing=0 cellpadding=2 border=1>';
    myTable += "<tr><td>S.No.</td><td>Date</td><td>Time</td><td>Complaint(s)</td></tr>";
    var url = "http://localhost:8080/POS/rest/WebServices/getHistory/"+cust_id.value;


   $.getJSON(url, function(json) {

       $.each(json, function(i, v) {

           myTable += "<tr><td>" + v.date + "</td><td>"+ v.time + "</td><td>" + v.issue
           + "</td><td>" ;
      });

 });


what i have to do here is,when i clicked the button the function is called and the corresponding result is stored in mytable variable and the result varailbe has to be displayed in history page. here how to navigate from detailsform to historypage while calling the function???
Can anyone help me out to do this?
Thankyou
QuestionFormat var to special format Pin
Member 1056002225-Nov-14 4:48
Member 1056002225-Nov-14 4:48 
AnswerRe: Format var to special format Pin
Richard MacCutchan25-Nov-14 6:56
mveRichard MacCutchan25-Nov-14 6:56 
GeneralRe: Format var to special format Pin
Member 1056002225-Nov-14 20:24
Member 1056002225-Nov-14 20:24 
QuestionGet Content of a Clicked Div in Iframe Pin
ASPnoob21-Nov-14 10:31
ASPnoob21-Nov-14 10:31 
AnswerRe: Get Content of a Clicked Div in Iframe Pin
Richard Deeming24-Nov-14 2:52
mveRichard Deeming24-Nov-14 2:52 
QuestionDisplay user Location on web app using GPS coordinates Pin
Member 1124572718-Nov-14 20:32
Member 1124572718-Nov-14 20:32 
AnswerRe: Display user Location on web app using GPS coordinates Pin
Anas R Firdousi9-Dec-14 14:37
Anas R Firdousi9-Dec-14 14:37 
QuestionTo Parse a URL Pin
Richard Andrew x6417-Nov-14 19:24
professionalRichard Andrew x6417-Nov-14 19:24 
AnswerRe: To Parse a URL Pin
Kornfeld Eliyahu Peter17-Nov-14 20:01
professionalKornfeld Eliyahu Peter17-Nov-14 20:01 
GeneralRe: To Parse a URL Pin
Richard Andrew x6417-Nov-14 20:10
professionalRichard Andrew x6417-Nov-14 20:10 
QuestionExternal .js file vs. script tags; how does it work? Pin
stevebrulerules17-Nov-14 12:34
stevebrulerules17-Nov-14 12:34 
AnswerRe: External .js file vs. script tags; how does it work? Pin
Peter Leow17-Nov-14 14:06
professionalPeter Leow17-Nov-14 14:06 
Questionfirefox addon. required(sdk/tabs).attach() not working Pin
alborozd17-Nov-14 4:45
alborozd17-Nov-14 4:45 
AnswerRe: firefox addon. required(sdk/tabs).attach() not working Pin
ZurdoDev17-Nov-14 5:23
professionalZurdoDev17-Nov-14 5:23 
QuestionCode Modify for JS Pin
Member 1123853816-Nov-14 13:05
Member 1123853816-Nov-14 13:05 
AnswerRe: Code Modify for JS Pin
Richard MacCutchan16-Nov-14 21:39
mveRichard MacCutchan16-Nov-14 21:39 
QuestionRe: Code Modify for JS Pin
ZurdoDev17-Nov-14 5:24
professionalZurdoDev17-Nov-14 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.