Welcome Guest, Not a member yet? Register   Sign In
direct to specific part of page

Hello everyone... i am new to code igniter.

controller code:

public function confirm()
$this->form_validation->set_rules('mem_name', 'Member Name', 'trim');
$this->form_validation->set_rules('mem_no', 'Membership No.', 'trim|required');
$this->form_validation->set_rules('mem_tel', 'Contact No.', 'trim|required');
$this->form_validation->set_rules('mem_email', 'Email', 'trim|valid_email');
//$this->form_validation->set_rules('order_quantity', 'Promo Code', 'trim|required');

if($this->form_validation->run() == false){
$lang = (isset($_GET['lang']))? (($_GET['lang']=='1')?'1':'2') :'1';
$data['title'] = $this->lang->line('wtmemberstore');
$data['main_content'] = 'view-wtmemberstore_order.php#signupform';
$data['lang'] = $lang;
$this->load->view('includes/template', $data);

$email = $this->input->post('mem_email');


when the form validation returns false "wtmemberstore_order" page loads up. But the form is at the bottom of the page. I want the bottom part of the page to be loaded when form validation is false.

Please help me...thanks in advance

Hi can you post the code for the view please!

(This post was last modified: 08-27-2015, 10:33 AM by jLinux.)

Is that two ternary operators in one?

Why not do:
PHP Code:
$lang = (@$_GET['lang'] == 2); 

PHP Code:
$lang = (isset($$_GET['lang']) && $$_GET['lang'] == 2); 

Just to simplify it

As far as your initial question, I would use an anchor.. (Ctrl + F Anchor)

Then just have them sent to /the/page/#form_name

More info: http://www.echoecho.com/htmllinks08.htm

thanks for the reply every one.....i have solved it...had to change the action path in the view...

Theme © iAndrew 2016 - Forum software by © MyBB