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

  • Home
  • SEARCH
  • 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 3488442
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:16:16+00:00 2026-05-18T11:16:16+00:00

I’m making a XHTML Page, and i’m using php to generate it. So, now

  • 0

I’m making a XHTML Page, and i’m using php to generate it. So, now I’m generating a combobox like this:

<select id="Indexer_Backend_select" size="1" onchange="changeHidBySelect('all_id')">
    <option value="nr1">nr1</option>
    <option value="nr2">nr2</option>
    <option value="nr3" selected="selected">nr3</option>
</select>

So, now, in some cases, it’s working, and in some othere cases, there is just the toppest selected.

Why this? I’m seriously blockd, so I don’t know at all how to go on…

thx for help

EDIT:

-I’m using Firefox

-I just wrote this everywhere, it gets generated by a PHP function which looks like this:

function createOptions($defaultvalue,$curr_path,$default_important,$only_modules) {

###############################################################################################
## String createOptions($defaultvalue string, $curr_path string, $default_important boolean, ##
##                      $only_modules boolean);                                              ##
##                                                                                           ##
## This function returns all the Modules which can be selected in every workflow.            ##
## The Return value is a string (the HTML-Code for the <select>-Wheel)                       ##
##                                                                                           ##
## $defaultvalue describes the preselected value. If none is set, the toppest (alphabetic    ##
## order) is selected. For more, read param $default_important...                            ##
##                                                                                           ##
## $curr_path describes the path, on which the select's ID is based.                         ##
##                                                                                           ##
## $default_important describes, if it is important to recognize, if no default-value was    ##
## given. If true, every time, no default-value was given, a little star is displayed        ##
## next to the <select>. If false, this won't be displayed.                                  ##
##                                                                                           ##
## $only_modules says, if the complete select tag or only all the <option>-Entrys should be  ##
## returned. So, if set to true, only a list of <option>-Tags will be returned.              ##
###############################################################################################
//Get global var $config... In there are the names for the options
global $config;
//Calling Global Array $config...
$options = $config["Indexer"]["Modules"]; //In here are the diffrent options
//Now creating options wheel...
$options_wheel = "";
if (!$only_modules) {
    $options_wheel = "<select id=\"" . $curr_path . "_select\" size=\"1\" onchange=\"changeHidBySelect('" . $curr_path . "')\">";
}
$default_set = 0;
foreach ($options as $key => $value) {


    $options_wheel .= "<option value=\"" . $options[$key]["Class"] . "\"";
    if ($options[$key]["Class"] == $defaultvalue) { //in $options[$key]["Class"] are the values saved, e.g. "nr2"
        $options_wheel .= " selected=\"selected\"";
        $default_set = 1;
    }
    $options_wheel .= ">" . $options[$key]["Class"] . "<";
    $options_wheel .= ($only_modules ? "\\" : "");
    $options_wheel .= "/option>";        

} 
if (!$only_modules) {
    $options_wheel = $options_wheel . "
    </select><input type=\"hidden\" id=\"" . $curr_path . "_hidvalue\" name=\"" . $curr_path . "_hidvalue\" value=\"" . $defaultvalue . "\" />
    ";
}
if (($default_set == 0)&&($default_important == true)) {
    $options_wheel .= "*";
} 
return $options_wheel;

}

And if I call this function now, I call it like this:

echo createOptions($value4,$options_path,true,false); 

$value4 is the defaultvalue, for upper example this would be “nr1”

So, and if I watch the code now with firebug or as source, there is sometimes a selected=”selected” which works, but in other cases there is one which simply not works, and the first element is shown.

  • 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-18T11:16:17+00:00Added an answer on May 18, 2026 at 11:16 am

    So guys, another question self-solved within one hour while posting. I just found why:

    I’m calling after all displaying a JS function, which manipulates a div next to this div with the select in it, and it seem to change it somehow. So but now if I disabled this function, it worked perfectly. So I’ll edit this function now 😉 thx for help

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have some data like this: 1 2 3 4 5 9 2 6

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.