How do I make form or table where certain numbers update according to a formula when the user enters one number?

Hi, I am an amature website designer and have made a website
using dreamweaver. I am very lost when it comes to doing tougher
things in dreamweaver. I want to create a small form or a table
where there will be 7 or so numbers that are generated based on
simple formulas for each one once you enter one number. Can someone
please help me with this task whether it is in dreamweaver or even
making it out of flash or anyway that this would be the easiest to
make possible. Thanks

Here's a very simple form you could use to perform a
calculation, it this case, squares the input value and writes it
back to another input field... Hopefully you can use this as a
pattern to apply your own algorithm. You'll need to do validation
to assure the entered fields are appropriate for the calculation
(required fields are entered).
Hope this gets you started.
================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8"
http-equiv="Content-Type" />
<script type="text/javascript">
function squareit() {
var num = document.getElementById('myinput');
var res = document.getElementById('myresults');
res.value = Math.pow(parseFloat(num.value), 2);
</script>
</head>
<body>
<form id="myform">
<label for="myinput">Number: </label><input
id="myinput"><br/>
<label for="myresults">Result: </label><input
id="myresults"><br/>
<input type="button" value="Calculate"
onclick="squareit()"/>
</form>
</body>
</html>

Similar Messages

  • How to add a field to the selection screen and when the user enters ...

    hi all,
    can any one plesase send the code of how to add a field to seletiion screen and when the user enters in the field , it should be store in the database table , the table is MKPF and the field is BKTXT.  Thanks.

    Hi Kripa,
       If u r using PNP ldb then the screen u will get is the screen for that ldb and if u want to add some more fields then u define using selection-screen..as follows
    SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE text-111.
    PARAMETERS: n_in_en  RADIOBUTTON GROUP g1,
                q_ev  RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK mysel.
    SELECTION-SCREEN BEGIN OF BLOCK mysel1 WITH FRAME TITLE text-222.
    PARAMETERS: r_date TYPE sy-datum DEFAULT sy-datum.
    SELECTION-SCREEN END OF BLOCK mysel1.
    SELECTION-SCREEN BEGIN OF BLOCK mysel2 WITH FRAME TITLE text-333.
    PARAMETERS:f_ver(3) TYPE c DEFAULT 1,
               c_no(10) TYPE c DEFAULT '9D0161',
               u_id(15) TYPE c,
               password(15) TYPE c,
               r_email(30) TYPE c DEFAULT PARAMETERS: s_not TYPE c AS CHECKBOX.
    PARAMETERS:t_run TYPE c  AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK mysel2.
    SELECTION-SCREEN BEGIN OF BLOCK mysel3 WITH FRAME TITLE text-444.
    SELECTION-SCREEN BEGIN OF BLOCK mysel4 WITH FRAME TITLE text-555.
    PARAMETERS: p_ser  RADIOBUTTON GROUP g2,
    a_ser  RADIOBUTTON GROUP g2.
    SELECTION-SCREEN END OF BLOCK mysel4.
    SELECTION-SCREEN BEGIN OF BLOCK mysel5 WITH FRAME TITLE text-666.
    PARAMETERS:p_path TYPE string.
    SELECTION-SCREEN END OF BLOCK mysel5.
    SELECTION-SCREEN END OF BLOCK mysel3.
    u will get this additional screen after the screen of ldb.
    I hope this will help u..
    Thanks & Regards
    Ashu Singh.

  • How to keep a calculation field blank until the user enters a number?

    I am building a sales sheet for a school that sells scrip as a fund-raiser. I have the document set so that when the user enters the number of scrip certificates he wants (say, two $25 gift certificates at Lowe's), the program will automatically calculate that this user owes $50 for that scrip category. However, there are more than 100 companies that one can choose from, and if the user doesn't enter a number, the calculated field shows $0. Is there a way that each field can stay blank until the user enters a number bigger than zero? By the way, I'm using this calculation to determine the value (borrowed from a user on this forum): event.value = 50 * this.getField("Lowes").value
    Thanks!

    There are two approaches. You can either add the following Validate script:
    // Custom Validate script for calculated field
    if (+event.value !== 0) event.value = "";
    Or you can change your custom Calculate script and set the Format type of the field to "None":
    // Custom Calculate script
    (function () {
        var v = +getField("Lowes").value;
        event.value = (v !== 0) ? util.printf("$%.2f", v) : "";

  • How i can make forms read form nls and reports read from anather

    hi evrey one
    how i can make forms read form nls_lang and reports read from anather nls_lang ,
    I think that this property is found in the file format .ini,
    I forgot his name,
    Is there one has found this information,
    pleez share.
    thanks.

    At a minimum, the creation of the TcpClient will need to change its parameter to the name of server you want to use:
    TcpClient tClient = new TcpClient("gmail-smtp-in.l.google.com", 25);

  • How to make a text field required at run time when the user clicks the checkbox ?

    I got a form where , there are several checkboxes and text fields associated with that checkboxes.If the use clicks on the check box then the associated
    text fields should become required.I have tried the change event and the click event for the checkboxes.It gives error in the onChnage event and I got some weird results in the on click event .Sometimes if the user click the check box , then for the 1st time the field doesnt become required , then the user onclicks the check box and when the user clicks the checkbox for the second time the field becomes required,but if i deselects the highlighted field option and selects it again the field becomes required even if the user onchecks it I am totally confused !!! Adding to it i have also written the wrong code still i achieved the desired result ?? How it can be possible . I am writing the codes below , please help me as i am working under a deadline from the client.
    onChange event :
    var newVal = this.boundItem(xfa.event.newText);
    if(newVal == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "disabled";
      else
         xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "error";
    For the onClick event :
    var a = xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovere d_OnlyEnergyCharges").rawValue;
    //app.alert(a);
    if(a == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "error";
      if(a == 1)
          xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "disabled";
       Please help someone !!!

    I used the onchange event and wrote the code for it. I got the result . But there is a problem.All these fields are in a table and it's a dynamic table where you can add rows dynamically at the run time .I have other change event for some fields in this table .All are working fine when i add the row.But for this check box the required fields are not validated as required at the run time . I am here giving the code , Please help me .
    form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharge s::change - (JavaScript, client)
    if(this.rawValue == "1")
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory= "error";
    else
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandator = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory = "disabled";

  • How to get the User entered value in the Submit request form for a parameter of a concurrent program in Oracle applications.

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

  • How can I create a scrolling effect where when the user scrolls down the image will blur out?

    How can I create a scrolling effect where when the user scrolls down the image will blur out?

    Hi there,
    You can create a scroll motion where the image will fade out on scrolling, you need to use the Opacity tab under Scroll Effects Panel.
    If you particularly need the image to be blur out, then you need to edit that image in any image editing program and make one copy of that image as blurred, then place both images (actual and blurred) on that page and use scroll motion or fade option to replace images.

  • How do you make room on your start up disk.  i am trying to do the update but don't have enough space

    how do you make room on your start up disk.  i am trying to do the update but don't have enough space

    Try this:
    1. Open "Finder", then navigate to "Movies" on the left side. Click on "iMovie Projects"
    2. Move desired movies and clips to trash, or your flash drive.
    *PS* Its dangerous to have a full hard drive, I would recommend either trashing, or transferring files to another computer. Trash applications you no longer use as well.

  • How to export a form that has Asian language in it to CSV file? Currently the CSV file shows [...] for Asian language characters

    How to export a form that has Asian language in it to CSV file? Currently the CSV file shows [...] for Asian language characters

    Hi George,
    Thanks! It does work in XML format. But since I would need to present the data in a spreadsheet, is there any other way I could go around it?
    Cheers,
    Su Ann

  • How do I create a form field ONLY template in Acrobat 9 Pro that will let the user enter and print only the form field data on a pre-printed form?

    This template will be used to type in information that will then be printed on an agency's official, barcoded form loaded in a printer (instead of blank paper.)  Only the user-entered info should print on the pre-printed form.  Users will use Adobe Reader to complete their templates; they do not have Acrobat.  Thank you!

    Use the template as non-printable background and add the form fields.

  • How do I make a cell equal a certain degree of a 360° zodiac point?

    I need to make a cell equal a certain degree on a 360° zodiac point when typing a number from 0-359. For example, if I would put in the number "10" in a cell it would give me "10 Aries" as a result in the cell. Doing 360 "if, then" statements is not desirable, and I don't think it is possible in Numbers. Usually spreadsheet programs have a limit on the number of "if, then" statements that can be "nested" in a cell. One friend recommended "concatenating," but this sort of makes my head spin at the moment. Any help would be appreciated. Below are some "if, then" statements that I put into Microsoft Excel before it said I could not put in anymore.
    =IF(OR(D1=0),"0 Aries",IF(OR(D1=1),"1 Aries",IF(OR(D1=2),"2 Aries",IF(OR(D1=3),"3 Aries",IF(OR(D1=4),"4 Aries",IF(OR(D1=5),"5 Aries",IF(OR(D1=6),"6 Aries",IF(OR(D1=7),"7 Aries",IF(OR(D1=8),"8 Aries",IF(OR(D1=9),"9 Aries",IF(OR(D1=10),"10 Aries",IF(OR(D1=11),"11 Aries",IF(OR(D1=12),"12 Aries",IF(OR(D1=13),"13 Aries",IF(OR(D1=14),"14 Aries",IF(OR(D1=15),"15 Aries",IF(OR(D1=16),"16 Aries",IF(OR(D1=17),"17 Aries",IF(OR(D1=18),"18 Aries",IF(OR(D1=19),"19 Aries",IF(OR(D1=20),"20 Aries",IF(OR(D1=21),"21 Aries",IF(OR(D1=22),"22 Aries",IF(OR(D1=23),"23 Aries",IF(OR(D1=24),"24 Aries",IF(OR(D1=25),"25 Aries",IF(OR(D1=26),"26 Aries",IF(OR(D1=27),"27 Aries",IF(OR(D1=28),"28 Aries",IF(OR(D1=29),"29 Aries",IF(OR(D1=29),"29 Aries",IF(OR(D1=30),"0 Taurus",IF(OR(D1=31),"1 Taurus",IF(OR(D1=32),"2 Taurus",IF(OR(D1=33),"3 Taurus",IF(OR(D1=34),"4 Taurus",IF(OR(D1=35),"5 Taurus",IF(OR(D1=36),"6 Taurus",IF(OR(D1=37),"7 Taurus",IF(OR(D1=38),"8 Taurus",IF(OR(D1=39),"9 Taurus",IF(OR(D1=40),"10 Taurus",IF(OR(D1=41),"11 Taurus",IF(OR(D1=42),"12 Taurus",IF(OR(D1=43),"13 Taurus",IF(OR(D1=44),"14 Taurus",IF(OR(D1=45),"15 Taurus",IF(OR(D1=46),"16 Taurus",IF(OR(D1=47),"17 Taurus",IF(OR(D1=48),"18 Taurus",IF(OR(D1=49),"19 Taurus",IF(OR(D1=50),"20 Taurus",IF(OR(D1=51),"21 Taurus",IF(OR(D1=52),"22 Taurus",IF(OR(D1=53),"23 Taurus",IF(OR(D1=54),"24 Taurus",IF(OR(D1=55),"25 Taurus",IF(OR(D1=56),"26 Taurus",IF(OR(D1=57),"27 Taurus",IF(OR(D1=58),"28 Taurus",IF(OR(D1=59),"29 Taurus",IF(OR(D1=60),"0 Gemini",IF(OR(D1=61),"1 Gemini",IF(OR(D1=62),"2 Gemini"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

    Hi Mike,
    The first thing I noticed in your formula was the multiple OR() statements with a single argument.
    =IF(OR(D1=0),"0 Aries"
    OR(condition1,condition2,...) returns TRUE if any of the arguments is TRUE. With only one condition, it returns TRUE if D1=0 and FALSE if D1 contains any value except 0. The bare boolean statement D1=1 returns the same results with the same conditions.
    Although it's not too difficult to improve the efficiency of the formula, I would drop IF and use a little bit of math and the CHOOSE function (plus some concatenation) for what you want:
    From your formula, I gather each of the houses occupies a 30° sector, starting at 0, 30, 60, 90, etc. with "0 housename" at each of those values.
    To simplify the formulas I've done the calculations in three steps:
    A value in the range 0 to 359 is entered in D2.
    E2 is an intermediate cell that calculates the Quotient of that value divided by 30, then adds 1 to the result.
    =QUOTIENT(D2,30)+1
    This gives an index number that tells which house (1=Aries, 2=Taurus, 3=Gemini, etc.) that Zodiac point lies in.
    F2 is a second intermediate cell that calculates the remainder of the value in D2 divided by 30, the number appended before the name of the house.
    =MOD(D2,30)
    G2 choses the name by its position in a list of choices, basing the choice on the index number calculated in E2, then concatenates the number calculated in F2, a single space, and the name returned by CHOOSE into a single text string and returns that string to the cell.
    =F2&" "&CHOOSE(QUOTIENT(D2,30)+1,"Aries","Taurus","Gemini","3","4","5","6","7","8","9 ","10","11","12")
    To save space,here (and to avoid having to look up the rest of the Zodiac signs and their order ), I've used numbers in place of the rest of the names.
    The separate parts may be combined into a single formula:
    =MOD(D2,30)&" "&CHOOSE(E2,"Aries","Taurus","Gemini","3","4","5","6","7","8","9","10","11","")
    For details (and further examples) see the descriptions of each of these functions in the iWork Formulas and Functions User Guide. The guide, and the equally useful Numbers '09 User Guide, may be downloaded using the Application menu (in Numbers, the "Numbers" menu) items with those names.
    Regards,
    Barry

  • How to Unload the form when the user presses Escape Key

    Hi all
    I have tried several triggers for unloading the form when the user presses escape key,but none of them worked. Could any body give the trigger name and the code that unloads or closes the form when the user presses escape key.

    Hello,
    Change the EXIT entry of you ressource file:
    27   : 0 : "F4"             : 32 : "Exit"Francois

  • How can I make a JButton enabled when the user types smthg in a JTextField?

    Hello,
    I have a JButton and a JTextField on a frame. The JButton is disabled, myButton.setEnabled(false).
    How can I enable the button when the user types something in the text field? Just typing, not pressing enter.
    Thank you

    There isn't one, actually. What you need is a DocumentListener and you have to associate it with the document object associated with the field i.e.
    field2.getDocument().addDocumentListener() (new DocumentListener() {
    });

  • How to clear text fields when the user navigates back to the screen

    Hi,
    Does anyone have any idea on how to clear the text input fields and dropdown boxes when the user navigates back to the screen, say for e.g. create screen?
    My issue is that i have plenty of fields in the create screen within a form. Is there a way to avoid programaticaly blanking out every field and just do it at the form level using an api to reset to a state before the user entry?
    Thanks

    This code allows you to make it more generic, and you would need to tweak it if there are more than TextInput controls, but it should provide some ideas.
    As far as using states, you could use SetProperty to set the text to empty, but that might be messier.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.containers.FormItem;
          import mx.controls.TextInput;
          import mx.events.IndexChangedEvent;
          import mx.core.Container;
          private function clearSreen(evt:IndexChangedEvent):void{
            var view:Container = tn.selectedChild as Container;
            for each(var child:Object in view.getChildren()){
              if(child is FormItem){
                var subchild:DisplayObject = child.getChildAt(0);
                if(subchild is TextInput){
                  TextInput(subchild).text = "";
        ]]>
      </mx:Script>
      <mx:TabNavigator id="tn" resizeToContent="true"
        change="clearSreen(event)">
        <mx:Form id="frm1" label="View Number One">
          <mx:FormItem label="First name:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Last name:">
            <mx:TextInput/>
          </mx:FormItem>
        </mx:Form>
        <mx:Form id="frm2" label="View Number Two">
          <mx:FormItem label="Address1:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Address2:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="City:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="State:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Zip code:">
            <mx:TextInput/>
          </mx:FormItem>
        </mx:Form>
      </mx:TabNavigator>
    </mx:Application>
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.stardustsystems.com
    Adobe Flex Development and Support Services

  • How to get the Useru2019s position when the user doesnu2019t have CP relation

    We have a custom program which will add / delete attributes (In transaction PPOSA_BBP). It is working fine for users which were assigned with CP relation But it fails for users which doesnu2019t have CP relation (since we are getting the position of users form HRP1001 then we are retrieving the existing attributes based on the position after that updating the attributes) as we are getting the position from HRP1001 it fails for users were no CP relation.
    Help us how to get the Useru2019s position when the user doesnu2019t have CP relation. Suggest us any function module or how to query the HRP1001 or some other table if exists
    Regards
    Paul

    Hi Paul,
    Have a look at these tables.
    Using table BUT000 the central business partner data are stored, f.e. partner type, partner names, partner number, partner guid, person number, etc. In table BUTBKK the bank data to a business partner are stored.
    Central business partner address data
    The table ADRC is used for the address of a business partner. Table BUT020 links the business partner number with the address number. Using table BUT021 several addresses to a business partner with different usages (modes), f.e. correspondence or delivery address, can be stored. The personal data of a business partner person are stored with key person number in table ADRP. The person number is assignd to a business partner person in table BUT000. Communication data of business partners as e-mail, telephone, fax, etc. are stored in the tables ADDR1 u2013 ADDR12. The business address of a contact person or an employee consists of the organization address (company resp. org.-unit) and of an address addition, which describes f.e. a building, a room number, etc. The address addition is stored in table ADCP and is identified by the keys address number of the organization address and person number.
    Relationships between business partners
    Table BUT050 contains the relationships between a business partner organization and a business partner person using relation types. The relation types are defined in table TBZ9, f.e. the relation type u2018has employeeu2019 corresponds to identifier u2018BUR010u2019, the relation type u2018has contact personu2019 corresponds to identifier u2018BUR001u2019. Table BUT051 stores communication data of a contact person relationship (compare to table ADCP). Table BUT052 stores several address numbers to one business partner relationship (including a standard flag).
    Hope this helps,
    Kind Regards,
    Matthew

Maybe you are looking for