bwakad Posted June 19, 2014 Share Posted June 19, 2014 Due to an error on my side, I deleted a file before backing up. So, I had to make my page from scratch... but using the code below, I cant access the $input->value to check for errors. Tried $input->post / $input->get. Either with "contract" and ->contract. Must be forgetting something... It's driving me nutz! -- EDIT -- Forgot I first have to submit before getting value back. lol. really stupido! Answer in API: if ($input->post->submit_details){ $value = $input->post->contract; // access as object property echo $value; $value = $input->post['contract']; // access as array index echo $value; $value = $input->post('contract'); // access as function echo $value; } $form = "<div class='row'><div class='medium-8 columns'> <form action='./' id='details' method='post'> <fieldset><legend>Details of {$user->name}</legend> <div class='row collapse'><label for='contract'>Contract <small>Required</small> <select id='contract' name='contract' ><option value=''>Please select</option>"; foreach ($pages->get("/contract/")->children() as $child) { if (!empty($member_page->get('contract'))) $selected = $child->name == $member_page->get('contract')->name ? " selected='selected' " : ''; $form .= "<option$selected value='{$child->name}'>{$child->title}</option>"; } $form .= "</select></label></div> </fieldset><button class='button tiny' type='submit' name='submit_details' value='submit_details' id='submit'>Submit</button></form></div></div>"; 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now