Answer to Question #212507 in HTML/JavaScript Web Application for bharath

Question #212507

Develop User Interface as mentioned below as per the requirements:

Button One: Activate Button Two: Deactivate

Button One is pressed two fields and a button appear

Field 1: From Number Field 2: To Number

Button: Activate

Field 1 should auto-populate with the number queried from DB. And should not be changeable. The reason to still have a field is just to make it explicit what is happening.

When the Activate Button is pressed execute some action with parameter as below.

CALLACTION = "Call Forwarding On"

PHONENUMBER = From Number (From Field 1)

TOLLNUMBER = To Number (From Field 2)

Button Two is pressed a prompt and two buttons appear.

Prompt: "Are you sure you would like to deactivate the <Telephone Number>?" Where <Telephone Number> is the number initially queried.

Button 1: Yes Button 2: No



1
Expert's answer
2021-07-02T04:10:42-0400
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .container {
            position: absolute;
            width: 100%;
            height: 100vh;
        }
        .activate-form {
            width: 400px;
            height: 200px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            position: relative;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            display: none;
        }
        .active {
            display: block;
        }
    </style>
</head>
<body>
    <div class="container">
        <button class="active-btn">activate</button>
        <button class="deactivate-btn">deactivate</button>
        <form action="#" class="activate-form">
            <input type="tel" name="phone-num-from" id="phone-num-from">
            <input type="tel" name="phone-num-to" id="phone-num-to">
            <button>activate</button>
        </form>
    </div>
    <script>
        const activeBtn = document.querySelector('.active-btn')
        const activeForm = document.querySelector('.activate-form')
        activeBtn.addEventListener('click', () => {
            activeForm.classList.add('active')
        })
    </script>
</body>
</html>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS