Welcome Guest, Not a member yet? Register   Sign In
yet more form validation 1.7
#21

[eluser]soupdragon[/eluser]
That the validation rules are quite simply not being run - no error is password fields dont match, no errors if required fields missing completely or to short / long
#22

[eluser]TheFuzzy0ne[/eluser]
OK, Can you post your view?
#23

[eluser]soupdragon[/eluser]
tried the EDIT removing seller bit - no change

View

Code:
<h1 align="left">Shop eröffnen<br /></h1>
<br />

&lt;? $attributes = array('class' => 'email', 'id' => 'seller_reg');?&gt;

&lt;?=form_open('seller/seller_reg', $attributes); ?&gt;
<fieldset class="sellerreg">
<legend  class="sellerreg">Seller werden</legend>

&lt;?=(!empty($this->validation->error_string)) ? $this->validation->error_string.'<br><br>' : ''; ?&gt;


<div class="formLayout">

&lt;?        foreach ($form as $what => $do) {  ?&gt;
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">&lt;?=ucfirst($do['fields']['label']);?&gt; &lt;? switch($what) {
                                        case 'seller_name':
                                        case 'seller_password':
                                        case 'passconf':
    case 'email':
                                            echo '<span style="color:#FF0000">*</span> <br />';
                                        break;
                                    } ?&gt;
</label>
<span style="width: 160px; float: left;">

    &lt;?     foreach ($do['show'] as $thetype => $details) {
            $call = 'form_'.$thetype; ?&gt;
         &lt;? switch($thetype) {
                case 'dropdown':  ?&gt;
                &lt;?=$call($details['name'], $details['array'], $details['selected']);?&gt;
                &lt;?    break;
                    case 'radio':
                    $js = 'onFocus="blur()"';
                    foreach($details as $nr => $radio) {?&gt;
                        &lt;?=ucfirst($radio['value'])?&gt;&lt;?=$call($radio,'','', $js);?&gt;<br />
                &lt;?    }
                    break;
                    default: ?&gt;
                    &lt;?=$call($details);?&gt;
                &lt;?    break;
                    }
                    ?&gt;</span> <br />
&lt;?    } ?&gt;
    </div>
&lt;? } ?&gt;
    </div>

<img src="&lt;?=($base.'img/')?&gt;random.php?&lt;?=rand(24,101)?&gt;" alt="CAPTCHA image" width="60" height="20" vspace="1" align="top" /> --&gt;
<br />
<br />

<div>&lt;? echo form_submit('mysubmit', 'abschicken!'); ?&gt;</div>
<br /><br />
<p style="color:#FF0000" align="right">* fields required</p>
  </fieldset>
&lt;?=form_close();?&gt;
#24

[eluser]gafro[/eluser]
Code:
'Seller/seller_reg' => array(
                                    array(
                                            'field' => 'seller_name',
                                            'label' => 'lang:seller_name',
                                            'rules' => 'trim|required|min_length[4]|max_length[12]|xss_clean|callback_username_check'
                                         ),
                                    array(
                                            'field' => 'seller_password',
                                            'label' => 'lang:seller_password',
                                            'rules' => 'trim|required|matches[passconf]|xss_clean'
                                         ),
                                    array(
                                            'field' => 'passconf',
                                            'label' => 'lang:passconf',
                                            'rules' => 'trim|required|xss_clean'
                                         ),
                                    array(
                                            'field' => 'firmname',
                                            'label' => 'lang:firmname',
                                            'rules' => 'trim|required|xss_clean'
                                         ),
                                    array(
                                            'field' => 'firstname',
                                            'label' => 'lang:firstname',
                                            'rules' => 'trim|required|xss_clean'
                                         ),   <---------            
                              );

comma shouldn't be there?
#25

[eluser]TheFuzzy0ne[/eluser]
There seems to be a lot of funkiness going on in your view. I can't follow it. I'd like to suggest you save that view, and start a fresh with keeping everything simple in mind.
#26

[eluser]gafro[/eluser]
I second that. Front end needs as much separation as back end. Separate your CSS and JS pleaseSmile
#27

[eluser]cindor[/eluser]
[quote author="soupdragon" date="1236629585"]tried the EDIT removing seller bit - no change

View

Code:
<h1 align="left">Shop eröffnen<br /></h1>
<br />

&lt;? $attributes = array('class' => 'email', 'id' => 'seller_reg');?&gt;

&lt;?=form_open('seller/seller_reg', $attributes); ?&gt;
<fieldset class="sellerreg">
<legend  class="sellerreg">Seller werden</legend>

&lt;?=(!empty($this->validation->error_string)) ? $this->validation->error_string.'<br><br>' : ''; ?&gt;


<div class="formLayout">

&lt;?        foreach ($form as $what => $do) {  ?&gt;
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">&lt;?=ucfirst($do['fields']['label']);?&gt; &lt;? switch($what) {
                                        case 'seller_name':
                                        case 'seller_password':
                                        case 'passconf':
    case 'email':
                                            echo '<span style="color:#FF0000">*</span> <br />';
                                        break;
                                    } ?&gt;
</label>
<span style="width: 160px; float: left;">

    &lt;?     foreach ($do['show'] as $thetype => $details) {
            $call = 'form_'.$thetype; ?&gt;
         &lt;? switch($thetype) {
                case 'dropdown':  ?&gt;
                &lt;?=$call($details['name'], $details['array'], $details['selected']);?&gt;
                &lt;?    break;
                    case 'radio':
                    $js = 'onFocus="blur()"';
                    foreach($details as $nr => $radio) {?&gt;
                        &lt;?=ucfirst($radio['value'])?&gt;&lt;?=$call($radio,'','', $js);?&gt;<br />
                &lt;?    }
                    break;
                    default: ?&gt;
                    &lt;?=$call($details);?&gt;
                &lt;?    break;
                    }
                    ?&gt;</span> <br />
&lt;?    } ?&gt;
    </div>
&lt;? } ?&gt;
    </div>

<img src="&lt;?=($base.'img/')?&gt;random.php?&lt;?=rand(24,101)?&gt;" alt="CAPTCHA image" width="60" height="20" vspace="1" align="top" /> --&gt;
<br />
<br />

<div>&lt;? echo form_submit('mysubmit', 'abschicken!'); ?&gt;</div>
<br /><br />
<p style="color:#FF0000" align="right">* fields required</p>
  </fieldset>
&lt;?=form_close();?&gt;
[/quote]

form_validation class has changed with CI 1.7.0.

try changing
Code:
&lt;?php echo validation_errors(); ?&gt;
instead of

Code:
(!empty($this->validation->error_string)) ? $this->validation->error_string.'<br><br>' : '';
#28

[eluser]soupdragon[/eluser]
well cant see that make a great deal of difference but here is what it produces.


Code:
&lt;?=(!empty($this->validation->error_string)) ? $this->validation->error_string.'<br><br>' : ''; ?&gt;

&lt;form action="seller/seller_reg" method="post" class="email" id="seller_reg"&gt;&lt;fieldset class="sellerreg">
<legend  class="sellerreg">Seller werden</legend>
<div class="formLayout">
<div class="testing">
<label class="reg" style="width: 200px; float: left;">Username <span style="color:#FF0000">*</span> <br /></label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="seller_name" value="" id="seller_name" maxlength="100" size="50" style="width:40"&gt;    </span> <br />
    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Password <span style="color:#FF0000">*</span> <br /></label>
<span style="width: 160px; float: left;">&lt;input type="password" name="seller_password" value="" id="seller_password" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Password Confirmation <span style="color:#FF0000">*</span> <br /></label>
<span style="width: 160px; float: left;">&lt;input type="password" name="passconf" value="" id="passconf" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
</div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Firmen name </label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="firmname" value="" id="firmname" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Vorname </label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="firstname" value="" id="firstname" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
</div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Nachname </label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="lastname" value="" id="lastname" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
    </div>

<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Str. </label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="street" value="" id="street" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Plz </label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="plz" value="" id="plz" maxlength="100" size="50" style="width:40"&gt;                </span> <br />

    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Stadt </label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="city" value="" id="city" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Email Address <span style="color:#FF0000">*</span> <br /></label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="email" value="" id="email" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Telefon </label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="tel" value="" id="tel" maxlength="100" size="50" style="width:40"&gt;                </span> <br />

    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Handy </label>
<span style="width: 160px; float: left;">
&lt;input type="text" name="handy" value="" id="handy" maxlength="100" size="50" style="width:40"&gt;                </span> <br />
    </div>
<div class="testing">
<label class="reg"   style="width: 200px; float: left;">Typ </label>
<span style="width: 160px; float: left;">
Privat&lt;input type="radio" name="type" value="privat" id="type" style="margin:10px"&gt;&lt;br />
Firma&lt;input type="radio" name="type" value="firma" id="type" style="margin:10px"&gt;&lt;br />
</span> <br />
    </div>
    </div>
#29

[eluser]soupdragon[/eluser]
ha ! cindor you're a hero !!!!!

i knew it was something stupid caused by the update !

Thats it !!!


Thanks a million .....can now get on with converting the other 10 forms :-)
#30

[eluser]TheFuzzy0ne[/eluser]
Nice one. I totally missed that, sorry for taking you on a joy ride in the opposite direction to where you wanted to go.




Theme © iAndrew 2016 - Forum software by © MyBB