Welcome Guest, Not a member yet? Register   Sign In
access parameter in a javascript function
#1

[eluser]ranjitbd[/eluser]
// this is a javascript function call from a view page with no parameter

<div align="center" style="font-size:16px; color:#FFFFFF; font-weight:bold;">
&lt;input type="submit" name="submit" id="submit" value="Search Holiday"/&gt;
&lt;input type="button" name="home" value="Home"&gt;
</div>

// this is the javascript function

function backButton(pageName)
{
var uri = pageName;
[removed].href=uri;
}

// here is the method in the controller holiday.php which is inside the user folder

function index()
{
$data = array();
$data['package_name'] = $this->holiday->get_package_name();
$data['package_duration'] = $this->holiday->get_package_duration();
$data['package_theme'] = $this->holiday->get_package_theme();
$data['mainContent'] = $this->load->view('holiday/holiday', $data, TRUE);
$this->load->view('index', $data);
}

// my question is if i send a parameter as 1 to the '&lt;?php echo base_url();?&gt;user/holiday/index.html' method in the controller
// then what will be the code in javascript function and in the controller...
#2

[eluser]ranjitbd[/eluser]
Code:
[quote author="ranjitbd" date="1261397045"]// this is a javascript function call from a view page with no parameter

<div align="center" style="font-size:16px; color:#FFFFFF; font-weight:bold;">
    &lt;input type="submit" name="submit" id="submit" value="Search Holiday"/&gt;
    &lt;input type="button" name="home" value="Home"&gt;
</div>

// this is the javascript function

function backButton(pageName)
{
    var uri = pageName;
    [removed].href=uri;
}

// here is the method in the controller holiday.php which is inside the user folder

function index()
{    
    $data = array();
    $data['package_name'] = $this->holiday->get_package_name();
        $data['package_duration'] = $this->holiday->get_package_duration();
    $data['package_theme'] = $this->holiday->get_package_theme();
    $data['mainContent'] = $this->load->view('holiday/holiday', $data, TRUE);
    $this->load->view('index', $data);
}

// my question is if i send a parameter as 1 to the '&lt;?php echo base_url();?&gt;user/holiday/index.html' method in the controller
// then what will be the code in javascript function and in the controller...[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB