Hello,

I'm displaying information, but I'm trying to figure out how to create a button that says "change details" and in the exact place of the displayed information, there will be input fields where you can change details

ex:

Color : Blue
Size : Large

(link or button for change detail here)

if you click on the link or button to change the detail, those static texts will change into drop down selection forms. I was wondering how to do that?

Thank you

It's quite simple, and you can do it in a lot of ways.

One one is to have an hidden drop down that'll be shown as the user clicks the button, and at the same time you need to hide the label that os appearing.

Another way is to request the drop down data to the server when the user clicks the button and then create the options dynamically.

Another way is to request the entire drop down to the server and just use the innerHTML property to set it.

And then you'll need a button to get the new information and send it to the server, and then change it back to the label only.

Hope it helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.