Php edit form select option

Php edit form select option

Author: diogen Date of post: 12.06.2017
php edit form select option

There is a few ways to do this. For example, if You have something like this:.

PHP: PHP and HTML - Manual

Hope someone finds this useful, and also that someone can contribute and make the example better. More Posts - Website. By Nikola Vasiljevski — January 17, Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

You have an error in your code. De no hacerlo, al imprimir, las palabras selected value quedan pegadas y no funciona. Well I guess that you code got messed up on posting because there are to many error. The code should be, pretty much the same, just instead of comparing number you should compare strings to find out what should be selected.

What if, when you leave the page, and go back, you want the option you selected to now be shown instead of the default value? What should the php code be then please? Well you would need to save the selected value somehow and use it when opening the page.

You could read it from the database, store it in a file, use query string.. Here is a really simple example, using file.

php edit form select option

Leave a Reply Cancel Some HTML is OK. Email required, but never shared. Proudly powered by WordPress and Carrington. Vasiljevski Nikola Art is never finished, only abandoned Log in. Nikola Vasiljevski More Posts - Website Follow Me: Herman Nz says NB: I got trouble of inserting the code: October 4, , 3: WIS3 says You have an error in your code. So you example shiuld be: September 20, , Anyway, inside your select, the php code should be: September 21, , 6: Nikola Vasiljevski says You are right.

I corrected the code.

Dynamic Select Box - Edit Field?

October 16, , February 13, , 1: May 19, , 7: May 30, , 2: Rahul says or what should be in the case of a constant. Germain says Thank you very much for your help from France! June 19, , September 16, , 7: Nikola Vasiljevski says Well I guess that you code got messed up on posting because there are to many error. Can you, please, sent the code to me by mail and I will check.

September 27, , 7: Nikola Vasiljevski says The code should be, pretty much the same, just instead of comparing number you should compare strings to find out what should be selected.

Nikola Vasiljevski says Thanks, I updated the code on the page as you suggested. Nicky says What if, when you leave the page, and go back, you want the option you selected to now be shown instead of the default value?

September 27, , Nikola Vasiljevski says Well you would need to save the selected value somehow and use it when opening the page.

September 28, , 2: Max says What if you want to do this through a query string? September 28, , 3: Alex says Very nice, works like a sweet charm. Exactly what I was looking. January 3, , 5: September 14, , Angelo says It works for what I wanted to do! October 12, , Mike says Thanks — works like a charm.

October 29, , 6: Kevin says anyone still here? February 10, , 3: February 10, , 9: Leave a Reply Cancel Some HTML is OK Name required Email required, but never shared Web or, reply to this post via trackback. Recent Posts Auto Backup feature, Android 6. Blogroll Admiror Design Studio security-audit. Home Android WordPress Joomla Windows XP PS3.

inserted by FC2 system