Welcome Guest, Not a member yet? Register   Sign In
Weird form bug?
#1

[eluser]R. Oerlemans[/eluser]
Hi There,

When I was working there was a weird form bug, it worked in Safari & Firefox, but won't work in IE6(and 7).

This is my view:
Code:
<?php
                    if( isset($_POST['submit'])){
                                            
                        $in = "on";        
                        $tp = $this->input->post('telefoon');
                        $tv = $this->input->post('televisie');
                        $geenvoorkeur = $this->input->post('geenvoorkeur');
                        $bedrag = $this->input->post('bedrag');
                            
                        echo $in."<br />";
                        echo $tp."<br />";
                        echo $tv."<br />";
                        echo $geenvoorkeur."<br />";
                        
                        if($tv == "on" AND $in == "on" AND $tp == "on"){
                            $type = 4;
                        }elseif($tv == "on" AND $in == "on" AND $tp != "on"){
                            $type = 3;
                        }elseif($tv != "on" AND $in == "on" AND $tp == "on"){
                            $type = 2;
                        }elseif($tv != "on" AND $in == "on" AND $tp != "on"){
                            $type = 1;
                        }else{
                            $type = NULL;
                        }
                    
                    }else{
                        $type=1;
                        $geenvoorkeur = FALSE;
                        $bedrag ="";
                    }
                        $cookie = $type;
                        
                        if($this->uri->segment(2) == "providers" AND $this->uri->segment(3) != ""){
                            $userID = trackClicks($this->uri->segment(3),$type);
                        }elseif($this->uri->segment(2) == "type" AND $this->uri->segment(3) != ""){
                            $userID = trackClicks(0,$this->uri->segment(3));
                        }else{
                            $userID = trackClicks(0,0);
                        }
                        
                    ?&gt;

                    <div class="choises rounded">
                        &lt;form method="POST" name="form_options" action="&lt;?= $_SERVER['REQUEST_URI']; ?&gt;"&gt;
                        <p>
                            <b>Wat voor abonnement zoekt u</b> <a href="&lt;?= $_SERVER['REQUEST_URI']; ?&gt;" style="text-decoration: none; color: #B1B1B1; border-bottom: 1px DOTTED #E1E1E1;">(Reset)</a>
                            &lt;input type="checkbox" class="checkbox" name="internet" value="on" id="internet" disabled="disabled" checked="checked" /&gt; <label for="internet">Internet</label>
                            &lt;input type="checkbox" class="checkbox" name="telefoon" value="on" id="telefoon" &lt;?php if($cookie == 4 || $cookie == 2 || $cookie == ""){ ?&gt; checked&lt;? } ?&gt; /&gt; <label for="telefoon">Telefoon</label>
                            &lt;input type="checkbox" class="checkbox" name="televisie" value="on" id="televisie" &lt;?php if($cookie == 4 || $cookie == 3 || $cookie == ""){ ?&gt; checked&lt;? } ?&gt;  /&gt; <label for="televisie">Televisie</label>
                            &lt;input type="checkbox" class="checkbox" name="geenvoorkeur" value="on" id="geenvoorkeur" &lt;?php if($geenvoorkeur != ""){ ?&gt; checked&lt;? } ?&gt;  /&gt; <label for="geenvoorkeur">Geen voorkeur</label>
                            <b>| Maximaal p/m: &euro;</b>
                            <select name="bedrag">
                                <option value="">Alles</option>
                                <option value="10" &lt;?php if($bedrag == 10){ ?&gt;selected="selected" &lt;?}?&gt;>10</option>
                                <option value="20" &lt;?php if($bedrag == 20){ ?&gt;selected="selected" &lt;?}?&gt;>20</option>
                                <option value="30" &lt;?php if($bedrag == 30){ ?&gt;selected="selected" &lt;?}?&gt;>30</option>
                                <option value="40" &lt;?php if($bedrag == 40){ ?&gt;selected="selected" &lt;?}?&gt;>40</option>
                                <option value="50" &lt;?php if($bedrag == 50){ ?&gt;selected="selected" &lt;?}?&gt;>50</option>
                            </select>
                            &lt;input type="hidden" name="url" value="&lt;?= $_SERVER['REQUEST_URI']; ?&gt;" /&gt;
                            &lt;input type="image" src="/images/zoek.jpg" value="Verzonden" name="submit" id="submit" class="submit_button" /&gt;
                        </p>
                        &lt;/form&gt;
                    </div>
                &lt;?php

A little mess, bus the point is: When i click submit, the whole script work in FF & Safari, but doesn't do anything in IE. What's wrong with it?

kind Regards.
#2

[eluser]steelaz[/eluser]
Before "isset($_POST['submit'])" do "var_dump($_POST);". I if recall correctly, IE does something funny to input image names.




Theme © iAndrew 2016 - Forum software by © MyBB