Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default FORM LIVE UPDATE

    I am creating a page which has a number of forms,
    this page deals with accounts.

    The expensise are enetered in the relivatant forms and then they are saved in a mySQL db via PHP.

    THE PROBLEM

    The data is being saved fine and sum is added up HOWEVER
    the added data needs to also to be shown live on the page when entered and updated live as more values are entered in the fields.

    How do I do this I am at a total loss, the only way I can think is taking the data individualy and each time refreshing the page which is a fairly rough option to use.

    Thanks,
    David .F. Gowans
    [email]Gowans007@yahoo.com[/email]


    dfgowans007 Guest

  2. Similar Questions and Discussions

    1. Embed live cue data in live stream?
      I am currently using the new FME to encode live to a FMS. Both applicatioins are running on the same machine. Is there a way to embed live cue and...
    2. Live data feed within live flash video?
      Is there a way to encode some live data, say from a serial port into a live video stream? Windows media has such a feature within the script window.
    3. Fill form field in existing PDF from database live
      Hi, I'm wondering if this is possible. To have a pre-generated PDF on a server with an existing form field for a personalized message. Then,...
    4. Update Records form
      Dreamweaver MX 2004 ASP with VBasic I have a form page which passes a parameter to an update page. The parameter is passed for the first record...
    5. update form
      A value in an autonumber field is assigned by your database when the record is added to the table. It's not updateable, so you can't make use of...
  3. #2

    Default Re: FORM LIVE UPDATE

    Just use some JavaScript... it's easy.


    rob :: digitalburn Guest

  4. #3

    Default Re: FORM LIVE UPDATE

    any tips on how to do that or where to get the info to do it


    dfgowans007 Guest

  5. #4

    Default Re: FORM LIVE UPDATE

    Well, it's pretty easy, but no doubt they'll be some particular problems
    thrown up by exactly what you're doing.

    You need a function that detects whenever content is added to (or changed
    in) one of your input fields. The easiest way to do this, I should think, is
    to have the function called every time the focus is shifted away from one of
    these fields.

    All the function needs to do is take the value of the field being altered,
    and add it to the value already existing in your output field - simple :)

    So, assuming you have a form called 'stuff', with fields called input+a
    number and output, your function might look something like this-

    function changeOutput(n){
    //where n is the number of the input
    //there's no error checking, the function assumes you know what you're
    doing
    //findObj is a Macromedia function, if you don't have DW, you can use
    document.getElementById, but it's less robust in some cases

    frm=findObj('stuff');

    currentOutput=parseInt(frm.output.value);
    eval('inputValue=parseInt(frm.input'+n+'.value)');

    frm.output.value=currentOutput+inputValue;
    }

    That's very off-the-top-of-my-head, but it should work... there may be
    better ways of doing it...



    dfgowans007 wrote:
    > any tips on how to do that or where to get the info to do it

    rob :: digitalburn Guest

  6. #5

    Default Re: FORM LIVE UPDATE

    Ok ive had a go & sorta go something that sorta works HURRAY

    !!!!BUT!!!!!

    This needs to be inside a form which saves the data to a mysql db.
    but when it this script is inside another form it does'nt work ARG!!

    how can I get this to work,
    I dont need the totals to save as the db can work that out
    but each entered variable my be saved to the db.

    PAGE CODE ATTACHED

    <html>
    <head>
    <script language="javascript">
    <!--
    function addIt(){
    var value1 = document.adder.in_sloan.value
    var value2 = document.adder.in_parent_cont.value
    var value3 = document.adder.in_pt_job.value
    var value4 = document.adder.in_other.value
    document.adder.output.value = parseFloat(value1) + parseFloat(value2) + parseFloat(value3) + parseFloat(value4)

    var value5 = document.adder.in_sloan2.value
    var value6 = document.adder.in_parent_cont2.value
    var value7 = document.adder.in_pt_job2.value
    var value8 = document.adder.in_other2.value
    document.adder.output2.value = parseFloat(value5) + parseFloat(value6) + parseFloat(value7) + parseFloat(value8)

    document.adder.finalout.value = parseFloat(value1) + parseFloat(value2) + parseFloat(value3) + parseFloat(value4) + parseFloat(value5) + parseFloat(value6) + parseFloat(value7) + parseFloat(value8)

    }
    //-->
    </script>
    </head>
    <body>

    <FORM NAME="adder">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>&nbsp;</td>
    <td><table width="52%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><input name="in_sloan" type="text" onChange="addIt()" value=0 size=4>
    var1 </td>
    </tr>
    <tr>
    <td><input name="in_parent_cont" type="text" onChange="addIt()" value=0 size=4>
    var2 </td>
    </tr>
    <tr>
    <td><input name="in_pt_job" type="text" onChange="addIt()" value=0 size=4>
    var3</td>
    </tr>
    <tr>
    <td><input name="in_other" type="text" onChange="addIt()" value=0 size=4>
    var4 </td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td><input type="text" name="output" size="6">
    <strong> tot </strong></td>
    </tr>
    </table></td>
    <td>&nbsp;</td>
    <td><table width="44%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><input name="in_sloan2" type="text" onChange="addIt()" value=0 size=4>
    var5</td>
    </tr>
    <tr>
    <td><input name="in_parent_cont2" type="text" onChange="addIt()" value=0 size=4>
    var6</td>
    </tr>
    <tr>
    <td><input name="in_pt_job2" type="text" onChange="addIt()" value=0 size=4>
    var7</td>
    </tr>
    <tr>
    <td><input name="in_other2" type="text" onChange="addIt()" value=0 size=4>
    var8</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td><input type="text" name="output2" size="6">
    <strong>tot2</strong></td>
    </tr>
    </table></td>
    <td><input name="finalout" type="text" id="finalout" size="6">
    <strong>final tot </strong></td>
    </tr>
    </table>
    </FORM>

    </body>
    </html>




    dfgowans007 Guest

  7. #6

    Default Re: FORM LIVE UPDATE

    So... what you're saying is that when you try to call this function from a
    different form, it doesn't work? Is that it? Or...?

    Saving the output variables is kind of a non-issue as far as the whole thing
    working or not is concerned, they get passed to your PHP like all the rest,
    so you can either use them or not, it doesn't really matter.


    rob :: digitalburn Guest

  8. #7

    Default Re: FORM LIVE UPDATE

    no the scrpit works but when i put it inside the form needed to save the details to mySQL via php it stops working I think cos it has a form within a form, any ideas?



    dfgowans007 Guest

  9. #8

    Default Re: FORM LIVE UPDATE

    So you're nesting the whole of this form inside another form? Is that
    correct? If so, I don't think that nesting forms is ever a great idea. There
    should be another way to set up your page.


    rob :: digitalburn Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139