The value of dropdown after posting from IE7/8, displays as array, but normal value in firefox using PHP,HTML,JAVA(DHTMLSUITE modal message)

919

i am generating a dropdown in a twin forloop ( for loop inside a forloop)

when i post the same with IE7/8 i get the values as an array(array { [0] = 11_31_2}), but in firefox i get it as 11_31_2.

below is the following code i use

for ($k=1;$k<=strlen($weeklist);$k++) {
    if ($presentweek == 1) {
        $k = 0;
    }
    if (substr($weeklist,$k-1,1) == 1 || $presentweek == 1) {
        if ($presentweek == 1) {
            $presentweek++;
        }
        $selectedweekstarttime = $starttime + (60*60*24*7*$k);
        $selectedweekendtime = $selectedweekstarttime + (60*60*24*6);
        foreach ($meterreadergroup as $meterreader_id) {
            $readerid_selected = $readerselect == "" ? $meterreader_id : $readerselect;
            $has_rule = getPlanningRuleOfTheWeek ($readerid_selected,$selectedweekstarttime);
            $has_freeweek = getFreeTimeOfTheWeek ($readerid_selected,$selectedweekstarttime);
            if ($has_rule != "" || $has_freeweek != "") {
                if (stripos($problemweek,$getweeks[$k]) === false) {
                    $problemweek = $problemweek.$getweeks[$k].";";
                }
                $filldetails = "";
                if (is_array($has_rule)) {
                    $filldetails .= "Has Planningrules<br />";
                }
                if (is_array($has_freeweek)) {
                    $filldetails .= "Has freeweek/day";
                }
                $selectdetails = "";
                print "getweeks - ".$getweeks[$k]."<br>";
                $selectdetails .= "<select errorcheck='checkoptions' name='".$readerid_selected."_".$getweeks[$k]."' onchange='clearErrorFields(this,".$x.");'>
                <option value='".$readerid_selected."_".$getweeks[$k]."_0'>Choose Solution</option>
                <option value='".$readerid_selected."_".$getweeks[$k]."_1'>Leave this week for this meterreader out when copying</option>
                <option value='".$readerid_selected."_".$getweeks[$k]."_2'>Leave this entire week out when copying</option>
                <option value='".$readerid_selected."_".$getweeks[$k]."_3'>Remove current rules for meterreader and force new rules</option>
                </select>";
                $row_details[] = array($getweeks[$k],fetchMeterreaderDetails("vnaam,tv,anaam",$readerid_selected),$filldetails,$selectdetails,"<div id='error".$x."' ></div>");
                $x++;
            }
        }
    }
}

for example

name='".$readerid_selected."_".$getweeks[$k]."' eample name='11_31'

value='".$readerid_selected."_".$getweeks[$k]."_0' value ='11_31_2'

so when i $_REQUEST['11_31'] i expect the value as 11_31_2 i only get the value i expected in firefox, but for me in IE7/8 i get the value as array{ [0] = 11_31_2}

328

Answer

Solution:

This is a stab in the dark, but it's possible that IE is choking on the nonstandard "errorcheck='checkoptions'" attribute. I say this because the behavior you report (getting selection as an array) is what you'd expect from a <select multiple>, so maybe possibly there's a bug in IE, triggered by the nonstandard attribute, that makes it submit the element like a multiple select.

People are also looking for solutions to the problem: php - Is the amount of Mails i am trying to send as a Newsletter somehow connected to the risk of beeing marked as spam or even getting blacklisted?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.