Jump to content

benoit1980

Members
  • Content Count

    35
  • Joined

  • Last visited

Community Reputation

0 Neutral

About benoit1980

  • Rank
    Member
  1. I also tried another way as below(pure javascript) but I have a problem, I cannot get the bootstrap drop down menu staying aligned when it opens in a bootstrap column. Any idea why please? Thanks, Ben <!DOCTYPE html><html lang="en"> <head> <meta content="width=device-width, initial-scale=1.0" name="viewport" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style>.no-display { display:none; position:absolute; top:50px;}.btn-group { margin: 0 auto; text-align: center; font-size:0 !important;}.btn-group a { display:inline-block;}</style> <br><br><br><br> <div class="container text-center extra_pages_text_black"><div class="row clearfix"><div class="col-md-12 column"> <div class="row clearfix"><div class="col-md-12 column"><h2>Choose</h2></div></div><br><br><div class="row clearfix"><div class="col-md-5 column"><a href="#" id="button1" class="btn btn-lg btn-success">BUTTON1</a></div><div class="col-md-2 column"><h2>OR</h2></div><div class="col-md-5 column"><a href="#" id="button2" class="btn btn-lg btn-success">BUTTON2</a></div></div> <div class="row clearfix" id="eatin_takeaway_drop"> <div class="col-md-12 column"> <div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="false"> Dropdown <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1"> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li><li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li> </ul></div> </div></div><div class="row clearfix" id="delivery_drop"><div class="col-md-12 column">THIS IS THE RESULT OF BUTTON2</div></div></div></div></div> <script>$("#button1").on('click', function() { $("#eatin_takeaway_drop").fadeIn(); $("#delivery_drop").fadeOut();}); $("#button2").on('click', function() { $("#eatin_takeaway_drop").fadeOut(); $("#delivery_drop").fadeIn();}); </script> <!-- //CONTACTS --> <br><br><br><br> <br><br><br><br> <script src="../js/jquery/jquery-1.11.1.js"></script>
  2. Ok, I have found an example here: http://jsfiddle.net/EhtrR/1135/ And tried to make my own using bootstrap but all I see are my buttons and nothing else, the js is not showing or hidding the code in my div, any idea why please? Thanks <head> <script src="../js/jquery/jquery-1.11.1.js"></script><style>.no-display { display:none; position:absolute; top:50px;}</style></head> <script>$("#button1").on('click', function() { $("#eatin_takeaway_drop").fadeIn(); $("#delivery_drop").fadeOut();}); $("#button2").on('click', function() { $("#eatin_takeaway_drop").fadeOut(); $("#delivery_drop").fadeIn();}); </script> <br><br><br><br> <div class="container"><div class="row clearfix"><div class="col-md-12 column"><div class="row clearfix"><div class="col-md-6 column"><a href="#" id="button1" class="btn btn-lg btn-success">EAT IN / TAKE AWAY</a></div><div class="col-md-6 column"><a href="#" id="button2" class="btn btn-lg btn-success">DELIVERY</a></div></div><div class="row clearfix"><div class="col-md-12 column no-display" id="eatin_takeaway_drop">HI THIS IS THE RESULT OF BUTTON1</div></div><div class="row clearfix"><div class="col-md-12 column no-display" id="delivery_drop">HI THIS IS THE RESULT OF BUTTON2</div></div></div></div></div> Where did I do wrong? Any idea please? Thank you, Ben
  3. Hi, Thank for the reply, would you have an example of showing hiding the Div based on what is chosen in the drop down menu please? Also for the towns, do I need to use a switch case? Thank you, Ben
  4. Hi Everyone, Someone is asking me a bit of help on a website, I know a bit php and HTML5, I would like to know what would be the best of doing this please: 1)I need to create 2 big buttons, according to the choice of the buttons a different dropbox menu with towns will showup. 2)When the user chooses one of the town, in any drop down, I would like to show a different DIV with content in it. Here is a practical example: BUTTON A BUTTON B if Button A is pressed, show dropdown menu A if BUTTON B is pressed, show dropdown menu B If town 1 from dropdown menu A is chosen show DIV 1 If town 2 from dropdown menu A is chosen show DIV 1 If town 3 from dropdown menu A is chosen show DIV 2 If town 4 from dropdown menu A is chosen show DIV 3 If town 5 from dropdown menu A is chosen show DIV 1 If town 1 from dropdown menu B is chosen show DIV 6 If town 2 from dropdown menu B is chosen show DIV 5 If town 3 from dropdown menu B is chosen show DIV 5 If town 4 from dropdown menu B is chosen show DIV 6 If town 5 from dropdown menu B is chosen show DIV 4 How to do this without reloading the page please? Thank you, Bambinou
  5. Hello, I am having a real problem with this and would like to know if someone can give me a feedback. Thank you I am developing a website and would like to only let the access to a few people. I try to lock the website with an "allow" and "disallow" htaccess block but it seems to be slowing down the website a lot. The website at the moment is hard coded with https:// I am wodering if the .htaccess is correct. Sometime the pages load non stop and nothing shows up and sometime the pages are showing up. I remove the htaccess, everything is fine. here is the code: <Limit GET POST> order allow,deny allow from 89.187.79.200 #The next line modified by DenyIP #deny from all </Limit> Options +FollowSymLinks IndexIgnore */* RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] <Files 403.shtml> order deny,allow deny from all </Files> allow from xxx.xx.xx.xxx ###########FaceBook########### Allow from 31.13.24.0/21 Allow from 31.13.64.0/18 Allow from 66.220.144.0/20 Allow from 69.63.176.0/20 Allow from 69.171.224.0/19 Allow from 74.119.76.0/22 Allow from 103.4.96.0/22 Allow from 173.252.64.0/18 Allow from 204.15.20.0/22 Allow from 2401:db00::/32 Allow from 2620:0:1c00::/40 Allow from 2a03:2880::/32 ##########FaceBook############ Thanks in advance Ben
  6. Hi All, I would like to know if someone could help me with this, I have been struggling for days and cannot find an answer. I am new to OOP and still struggle a bit with the logic. I have installed Yii2 on my local machine, all I want is insert a date in the correct format in the database as: DD/MM/YYYY I cannot believe how hard it is just ti work this one out as a beginner....... I tried this: http://www.yiiframework.com/doc-2.0/guide-behaviors.html: And added this code inmy Posts Model: use yii\behaviors\TimestampBehavior; class User extends ActiveRecord { // ... public function behaviors() { return [ 'timestamp' => [ 'class' => TimestampBehavior::className(), 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at', ], ], ]; } } I have the corresponding database fields as created_at and updated_at set as INT. Unfortunately, when I try to save my form I get this error: PHP Fatal Error – yii\base\ErrorException Class 'app\models\ActiveRecord' not found1. in C:\wamp\www\yii2\models\posts.php at line 61 } public function behaviors() { return [ 'timestamp' => [ 'class' => TimestampBehavior::className(), 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at', ], ], ]; } } Any idea why please?I have followed the Yii website tutorial correctly but still cannot get the date input to work. Thank you, Regards, Ben
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.