Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6707093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:35:53+00:00 2026-05-26T07:35:53+00:00

Basically I have a HTML option box written like so: <span>Design </span><select name=style> <option

  • 0

Basically I have a HTML option box written like so:

<span>Design </span><select name="style">
    <option value="blueprint"> Blueprint</option>
    <option value="bubbles">Bubbly Bubbles</option
    <option value="carpet">Colourful Carpet</option>
    <option value="circles">Creative Circles</option>
    <option value="dots">Default Dots</option>
    <option value="hexagons">Honeycomb Hexagons</option>
    <option value="linen">Lovely Linen</option>
    <option value="loops">Loopy Loops</option>
    <option value="noise">Niché Noise</option>
    <option value="wiggles">Wiggly Wiggles</option>
    <option value="wood">Wunder Wood</option>
</select> 

The value of whichever is selected is inputted into a database using PHP and used to determine the style of the webpage. Obviously, however, whenever a user enters the settings panel in the backend of this, the option at the top of the list is show, I know I can use ‘selected’ to state which one is shown at the top however the one I want at the top needs to be the same as the one they selected and saved last time, in order to not cause confusion. How would I go about giving the ‘selected’ tag to the option that was selected and saved previously (the one that is in the database)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:35:53+00:00Added an answer on May 26, 2026 at 7:35 am

    You could read the settings with php on the same script that generates the form, and then iterate over each option. If the value is the same as the one on the database, echo() a selected='true' attribute to the element.

    The other method I would search would be with javascript. You could Ajax the saved value in the database and then change the selected attribute for the element that matches.

    I couldn’t really post code as I don’t know it right now, but I’m pretty sure with those tips you could get going..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an html-like xml, basically it is html. I need to get the
I would like to add a preprocessor to HTML pages. Basically, I have a
I've been battling to get this right...basically I have the following HTML setup: <div
I have a vertical menu in my system which is basically made of HTML
I have a 'template' system in my CMS rails app. Basically the whole HTML
I'm using (or trying to) JQuery Validation with WebForms/html. I have, basically (simplifying the
I basically have something like this: void Foo(Type ty) { var result = serializer.Deserialize<ty>(inputContent);
I have a empty select box on a form. <select id='essentialDocs[]' ></select> through some
I'm building a recipe-finder for a new food blog. The design I have basically
I have a question, regarding how the select text box is supposed to perform

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.