troubleshooting Question

How do I create this popup?

Avatar of Bruce Gust
Bruce GustFlag for United States of America asked on
Web DevelopmentjQuery
21 Comments1 Solution135 ViewsLast Modified:
Here's what my project looks like right now:

screenshot
The "More Detail" button needs to open up a modal where I'm going to have several fields displayed which the user can edit.

This is what I have so far:

<script>
$(document).ready( function() {
	let accountId=$('#accountId').val();
	$.get("http://devtest.simplevoip.us/ajax_functions.php?fn=get_account_devices&accountId="+accountId)
		.done((data) => {
			$.each(data, (i, elem) => {
				$('#michelle').append(`<tr><td>${elem.deviceId}</td><td>${elem.name}</td><td><button data-device-id='${elem.deviceId}' class='detail'>More Detail</button></td></tr><tr><td colspan="2"><span style="font-size:9pt; font-style:italic;">product detail</span></td></tr>`)
			})
		})
		.fail((error) => console.log(error))
		.always(() => console.log('Done'));
});
</script>

My button: <button data-device-id='${elem.deviceId}' class='detail'>More Detail</button>

...needs to open up a popup where the user will have the following fields

mac - The user-specified MAC address for this device (I'm assuming I'm going to have to grab that from somewhere base on https://whatismyipaddress.com/mac-address)

oldmac - In case the MAC setting was changed, this should contain the original MAC address (not sure what this means apart from displaying the current Mac address)

customerTemplateID - value of the SELECT generated in the previous step (I've got this one)

codec - Can be 'DEFAULT', 'G722', 'G711', or 'OPUS' Ithis will be a pulldown)

transport - Can be 'TCP', 'UDP', or ' DNS-NAPTR' (another pulldown)

accountid - Our test accountId (I have this)

line1 - Set this to the Device's Unique ID (not sure what that's going to be)

configID - Unique ID for config, should match ID retrieved in previous step (if I'm retrieving this, perhaps it's the ID of my computer? Open to suggestion on this one)

ip - An IP address (e.g. 192.168.144.1) (current IP address I suppose)

subnet - An IP subnet mask (e.g. 255.255.255.128) (current subnet)

gw - An IP address (e.g. 192.168.144.1) (another IP address)

syslog - A boolean flag (true or false) (I'm just going to create a pulldown for either true or false)

I've got to create a popup that populates the appropriate fields and then just displays the right options for everything else.

What a day!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 21 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 21 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros