Jump to content

roberto68

Members
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

0 Neutral

About roberto68

  • Rank
    Newbie
  • Birthday 10/24/1990

Profile Information

  1. so I changed $("#dropdowns").change(function() { for (every DD has that class) $(".dropdown-menu").change(function() { so it targets every DD but the buttons stays disabled all the time. And my last point - why are the dropdowns rolled out on page load - I want them to be hidden and show only on the click - which it does right now but on the page load it is "rolled out" not hidden as I excpect it to be right now it is like that // $("select").removeClass("dropdown-menu"); $('.dropdown-toggle').click(function(){ $('.dropdown-menu').toggle(); }); when I uncoment the 1st line DD are hidden onload but then they are not working anymore
  2. and here's html : just hte 1st dropwdown but it goes on like that <form name="dropdowns" id="dropdowns"> <div class="box"> <img src="images/pic1.jpg" alt="pic1"> <h2>education</h2> <label for='educationForm'>select what you wanna learn<br><div align="center" class="drop"> <a href="#" class="dropdown-toggle">select</a><select class="dropdown-menu" multiple="multiple" name="mydropdown1[]" id="dd1"><label="education"><option value="1">IT-programing</option><option value="2">IT-sys_admin</option><option value="3">IT</option><option value="4">science</option><option value="5">electronic engineering</option><option value="6">math&physics</option><option value="7">mechanical_engineering</option></select></label></div></label>
  3. I've form where htere are 4 multiselect dropdowns I use code like this ("dropdowns" is the id of that form) and there's nothing else in that form just those multiselects. $(".submit").attr('disabled','disabled'); // defaultne disabled $("#dropdowns").change(function() { // alebo cekovat kazdy dd zvlast if($(this).val()===""){ $(".submit").removeAttr('disabled'); } else { $(".submit").attr('disabled','disabled'); } }); maybe should I chcek all 4 DDs inside the .change(function ??? instead of if =($this) for (i=1; i<4; i++) { if($("#dd"+i).val()===""){ .... the ids are dd1....dd4. amd one littel question - I've seen somwhere .fliter(:selected) or smth like that - cause I've little probelms with this form retrieving on another page - so I'd like to post it one form - so when user clicks submit another multiselect = another form is created at that time actualy that newly created is posted
  4. I've 4 dropdowns (multiple select) - when value of any changes = user selects -> append that option to <ul>, if deselect => remove that option from <ul> that dropdowns are in 1 form so right now I've smth like this - I know it is not all OK $(".submit").attr('disabled','disabled'); // $("#dropdowns").change(function() { if($(this).val()===""){ $(".submit").removeAttr('disabled'); } else { $(".submit").attr('disabled','disabled'); }for (i=1; i<4; i++) { $('#"dd"+i option').each(function() { //check if smth is selected in each dd if($(this).is(':selected') { var sel = $(this).(':selected').val(); if( $('ul').has("li").val() == sel){ // if there is an li with that value } else{ $('<li>').text(sel).prependTo('.categories'); // <ul> called categories } } }); } });
  5. https://railsforum.com/topic/60691-could-not-locate-gemfile-or-bundle-directory-but-i-did-cd-my-project/
  6. but the probelm is with that from retrieving on another page - cause the form consist of 4 multiple select dropdowns. yeah but now i have an idea i retireve it like this var DD1 = <?php echo json_encode($_GET["mydropdown1"]) ?>; var DD2 = <?php echo json_encode($_GET["mydropdown2"]) ?>; .... and then I can concatenate those 4 fields into one, is it a good idea?
  7. ok so now I've corrected it - to explain it better : currently I've one multiselect Dropdown with devided by optgroup tags, but I've have template where there are 4 ( 3 are blank cause that's the problem how to post 4 dropdowns in 1 form) but that 1 Dropdown is working well right now - but I want 4 and optionaly show user what they've selected in some extra DD which'll be blank on document.ready
  8. I have 4 multuiple select elemts - Dropdown lists. When user selects an option I want that option appear in blank DD (or some textbox...) . If it's to complicated meaybe it'll be enough just to detect taht values selected in those dropdowns on button click. Here's my html <form name="dropdowns" id="dropdowns"><label for='educationForm'>select what you wanna learn<br><div align="center"><select multiple="multiple" name="mydropdown1[]" id="dd1"><option value="1">IT-programing</option><option value="2">IT-sys_admin</option><option value="3">IT</option><option value="4">science</option><option value="5">electronic engineering</option><option value="6">math&physics</option><option value="7">mechanical_engineering</option></select></div></label><label for='sportFrom'>move urself up!<br><div align="center"><select multiple="multiple" name="mydropdown2[]" id="dd2"><option value="8"></option><option value="9"></option><option value="10"></option><option value="11"></option><option value="12"></option><option value="13"></option>....... what should I do - chcek every of the dropdown to change and if changed get value /text of that option and append it to that "newly" created dropdown?
  9. I've find this on Stackoverflow - and it works fine $('#submit').attr('disabled', true);$('.required').keyup(function () { var disable = false; $('.required').each(function(){ //type hidden exclude if($(this).val()==""){ //notifikovat ze nefunguje GPS - adresa disable = true; } }); // tato funckia check text filedy ci su filled $('#submit').prop('disabled', disable); });
  10. https://developers.google.com/maps/documentation/javascript/events#EventArguments and yeah I read the intro at the top of that page dbclick is valid event
  11. function Person (name, age) { this.name = name; this.age = age;this.printMe = new function(){ return console.log("name" + Person.name + "age" + Person.age); };}// Now we can make an array of peoplevar family = new Array();family[0] = new Person("alice", 40);family[1] = new Person("bob", 42);family[2] = new Person("michelle", 8);family[3] = new Person("timmy", 6);// add the last family member, "timmy", who is 6 years oldfor (i=0; i < family.length; i++){ family[i].printMe; } It's simple I wanna print name and age but this way it isn't working
  12. no I do not have any error, when I doubleclick it only zooms in, I put alert box right after placeMarker but no alert appears , ok so i change dbclick to click and it works
  13. my approach is simple want a prompt box apper on doubleclick on google maps : user clicks yes (some form is rendered, another page - for now alert box appears) if no nothing.. but my code doesn't do teh work google.maps.event.addListener(map, 'dbclick', function(event) {placeMarker(event.latLng,"addEvents.html"); }); function placeMarker(location, page) {// render pop up box, to add event or cancel if (confirm("Press a button!") == true) { alert ("You pressed OK!"); // render pop up form //window.location.replace(page); // podla toho ci event or place var marker = new google.maps.Marker({ position: location, map: map }); map.setCenter(location); } else { alert ("cancel adding event"); // chcem pridat event } } the listener is placed inside this function (it finds wether geolocation is OK and if so it centers to the current postiion if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { I also add alert box inside this function - the alert box appears without problems
  14. for everyone else here's the answer http://stackoverflow.com/questions/28408357/disable-form-button-unless-all-text-input-fields-are-filled-in
  15. I've form consisting of multiple fileds and I need to disable sumit button unless user fill smth in those fileds ( all of the requiered ones). I've smth like this $(document).ready(function() { $("#submit").attr('disabled', 'disabled'); $("#eventName").keyup(function(){ // treba prerobit if($(this).val() != '') { $("#myText").keyup(function(){ if($(this).val() != '') {if (document.getElementById("start").value() !=""){ // mozno tiez (function){ but this is not dong the work. wouldn't be smth like while(1) and chcek if every filed is filled ( .val() !='') - wtih some timer ?
×