User Profile

Collapse

Profile Sidebar

Collapse
StarLavender
StarLavender
Last Activity: Sep 2 '13, 02:06 AM
Joined: Apr 21 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks for the help and now I manage to retrieve the data that I am needed from database. Then the data will be used in calculation. But now the system will read the correct value and path after the calculate button is clicked but not work with the others code.
    Part of the codes.

    Javascript code
    Code:
    <script type="text/javascript">
    function a()
    {
        var a= "<?php echo
    ...
    See more | Go to post

    Leave a comment:


  • How to use a value from a drop-down as a filter in a SELECT query?

    Hi. I want to have a query as below.

    Code:
    $sql = "SELECT amount FROM payment WHERE id = '$a'";
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
    $amount = $row['amount'];
    The value for $a variable is getting from the selection on drop down list. For example, the user select id=11, then the amount for this id is 10 which select from database. So how am I going to...
    See more | Go to post

  • StarLavender
    started a topic Search by drop down list and checkbox
    in PHP

    Search by drop down list and checkbox

    Hi. I want to create a search form using the drop down list and checkbox. First, the users have to select from drop down list whether they want to search by date or id. After that, for example, a new pair of drop down list will display for the users to choose the start date and end date. Second, the users have to check the checkbox to make sure what type of information that they want to filter. I have done the form for searching but I don't know...
    See more | Go to post

  • still not very clear because ajax is totally a new thing for me. What do you mean by what I have so far to retrieve the value? Is it the way I retrieve my value? Somethings as below,
    Code:
    $sql = "SELECT percent FROM stock WHERE id = '$id'";
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
    So I will use the percent in my calculation. Thanks in advance for the help.
    See more | Go to post

    Leave a comment:


  • Thanks for the reply. But can you show me the way to do calculation? Because I have to retrieve data from database for calculation. For example, the data that I retrieved from database is $a (php), then I have to use this value in javascipt calculation.

    for example, this is the code that I have to write in calculate.js file.

    Code:
    var payment = document.getElementById("paymentA").value = (document.getElementById("paymentB").value
    ...
    See more | Go to post

    Leave a comment:


  • I'm still not very clear. Can I write my ajax and javascript code in calculate.js file? So that I can do my calculation in calculate.js file. Moreover, how can I just retrieve a specific data from database to use in the calculation? Thanks in advance.
    See more | Go to post

    Leave a comment:


  • gits, thanks for the reply. Ya, it is cross-browser compatible. My database is MySQL. What should I do? Thanks.
    See more | Go to post

    Leave a comment:


  • How to retrieve data from database to use in a javascript app

    Hi. I have a calculate.js javascript file where all the function that execute the calculation is consist in this file. Now, I want to retrieve a data from the database for calculation and be done in this calculate.js file. I have search a lot of methods to do this but most said cannot do this from a client-side. Is it possible? How to achieve this? Thanks in advance.
    See more | Go to post

  • Thanks. Now I implement my coding as below.
    Code:
    <script type="text/javascript">
    function calAmount()
    {
    	if(document.getElementById("textfieldA").value != "")
    	{
    		var a = document.getElementById("textfieldC").value = (document.getElementById("textfieldA").value * (document.getElementById("textfieldB").value/100));	
    	}
    	
    	else
    ...
    See more | Go to post

    Leave a comment:


  • Hi, I have another question which related to the question above. For now, I have a drop down menu and new textfield D.
    Code:
    <select name="type" id="type">
    <option value="">-- Please select --</option>
    <option value="typeA" onChange="selectA()">Type A</option>
    <option value="typeB" onChange="selectB()">Type B</option>
    ...
    See more | Go to post

    Leave a comment:


  • Hi, Ramanan Kalirajan, thanks for the reply. I had solved my problem already without using any variables. Is there any weaknesses without using any variables? Because I find that most of the programmers will use variables to solve this kind of problem. Thanks again for your solution.
    See more | Go to post

    Leave a comment:


  • Hi, Ramanan Kalirajan, thanks for the reply. I have two different equations and these two different equations is based on user input in which textfield. So I still have the problem about this. Besides, I am not really clear about the variables that you used (val, tgtEl).
    See more | Go to post

    Leave a comment:


  • Hi, Dormilich, thanks for the reply. Ya, I know I should allow one of the textfield to be editable only, but in this case, the user is allowed to decide whether textfield B is going to fill or textfield C. So is there any other methods to solve this problem?
    See more | Go to post

    Leave a comment:


  • How to change data in multiple textfields dynamically

    hi..let's say I have 3 textfields, texfield A must be filled first, then textfield B and textfield C can be filled either one. If textfield B is filled, then for example (textfield A * textfield B), the answer will be shown at textfield C or vice versa.

    Below is part of my code.

    Code:
    <script type="text/javascript">
    function calculate()
    {
    	if(form.textfieldC.value != "")
    ...
    See more | Go to post

  • StarLavender
    started a topic JXTable
    in Java

    JXTable

    hi..I am really new in Java software development..I am trying to make sure that the JXTable will refresh or update the data after the save button is clicked which means that the JXTable will display the lastest data that retrieved from the database..as what I had googled through the methods to solve my problem, I had tried for 3 different methods..but they aren't work as what I expected..Besid es, I noticed that the JXTable cannot have duplicated...
    See more | Go to post

  • StarLavender
    replied to Radio button and textbox
    The textbox remain display NaN until all the radio button were checked, then display the correct value. Why?
    Code:
    var sum = 0;  
    for(var i=1;i<=7;i++)  
    {  
    sum += parseInt(document.getElementById("score"+i).value); 
    }  
    document.getElementById('total').value=sum;
    See more | Go to post

    Leave a comment:


  • StarLavender
    replied to Radio button and textbox
    yes. I get it already. Now I want to add up all the value in the textbox. But nothing display in the new textbox.
    Code:
    var sum = 0; 
    for(var i=1;i<=7;i++) 
    { 
    sum += parseInt(document.getElementById("score"+i).value);
    } 
    document.getElementById(sum).value=sum;
    See more | Go to post

    Leave a comment:


  • StarLavender
    replied to Radio button and textbox
    Sorry. I am not very clear. Can you show how I can do that? Thanks.
    See more | Go to post

    Leave a comment:


  • StarLavender
    replied to Radio button and textbox
    Now I can choose my radio button. So now where do I need to place the statement for textbox to display the value of radio button. Because I put as below, the number display at the different textbox, not the textbox that corresponding with the radio button when I select the radio button. Thanks in advance.
    Code:
    function calcRadio(radio, val)
    {	
            var arr = new Array();
            arr = document.getElementsByName(radio);
    ...
    See more | Go to post

    Leave a comment:


  • StarLavender
    replied to Radio button and textbox
    I had try this. But why it show in all textbox once a radio button was clicked? Moreover, it didn't calculate the value I expected. For example, for question 1, no matter what radio button (1,2,3,4,5) I clicked, it remains show value 1 in all the textbox. Why? Didn't the .value property will read the value for that radio button (for example, value 1,2,3,4,5) when it was checked and multiply with the number I write?
    Code:
    function calcRadio()
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...