Results 1 to 5 of 5

Thread: In JavaScript, Displaying Pressed button's Number and it's identification

  1. #1
    Join Date
    Jun 2017
    Location
    Bengaluru, Karnataka, India
    Posts
    15
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Post In JavaScript, Displaying Pressed button's Number and it's identification

    Here my question is how to print/display the numbers from pressed buttons(as shown in figure) using JavaScript. However, here I am working on a device and we have to control it from JavaScript. Below I have mentioned my code(.js) snippet:

    Code:
    // Numbers function
    function Numbers(cmd)
    {
        System.Print("Command Sent is: "+cmd);
        var num = cmd;
        System.Print("Button pressed is: "+num);
    }
    
    // Displaying Numbers
    function Display()
    {
        Numbers(num);
        num.toString();
        dbgPrint("Displaying number: " + num);
    
    }
    And parameters for this function I am passing from some other file(.xml) as standard.

    Code:
    <function name="Display" export="Display">
                <parameter name="display" type="string" description="Drag and drop this for clear-button function.">
                </parameter>
            </function>
            <function name="Numbers" export="Numbers">
                <parameter name="command" type="mcinteger" description="Drag and drop this command for Numbers.">
                <choice name="1" value="1"/>
                <choice name="2" value="2"/>
                <choice name="3" value="3"/>
                <choice name="4" value="4"/>
                <choice name="5" value="5"/>
                <choice name="6" value="6"/>
                <choice name="7" value="7"/>
                <choice name="8" value="8"/>
                <choice name="9" value="9"/>
                <choice name="0" value="0"/>
                </parameter>
            </function>
    Click image for larger version. 

Name:	VideoConf.jpg 
Views:	58 
Size:	21.4 KB 
ID:	6197
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	tele.jpg 
Views:	27 
Size:	53.7 KB 
ID:	6196  
    Last edited by jscheuer1; 08-09-2017 at 01:54 PM. Reason: I am attaching one more image here to get clarity and I hope that this will give you an idea about my project. later: format

  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,084
    Thanks
    1
    Thanked 205 Times in 201 Posts

    Default

    Hi there ak47,

    check out attachment to see a working example.

    I have not coded anything for the two green buttons,
    as I do not know what their functions are.

    coothead
    Attached Files Attached Files
    ~ the original bald headed old fart ~

  3. The Following User Says Thank You to coothead For This Useful Post:

    ak47 (08-10-2017)

  4. #3
    Join Date
    Jun 2017
    Location
    Bengaluru, Karnataka, India
    Posts
    15
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thank you.

  5. #4
    Join Date
    Jun 2017
    Location
    Bengaluru, Karnataka, India
    Posts
    15
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Is this script for an HTML page?

  6. #5
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,084
    Thanks
    1
    Thanked 205 Times in 201 Posts

    Default

    Hi there ak47,

    "Is this script for an HTML page?"
    Yes, that is correct.

    coothead
    ~ the original bald headed old fart ~

Similar Threads

  1. Displaying Photo Number
    By Herisson in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 07-25-2011, 08:52 AM
  2. Resolved Menu error when back button pressed
    By keyboard in forum CSS
    Replies: 1
    Last Post: 07-25-2011, 05:52 AM
  3. Web Template Identification
    By cancer10 in forum HTML
    Replies: 0
    Last Post: 07-07-2009, 05:08 PM
  4. Replies: 3
    Last Post: 09-22-2008, 05:27 PM
  5. Replies: 7
    Last Post: 08-12-2008, 05:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

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