• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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!

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...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.