Jump to content

erme

Members
  • Posts

    188
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

erme's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I set up this var prettyDate2 = (myDate.getDate()+1) + '/' + (myDate.getMonth()+1) + '/' + myDate.getFullYear(); $("#DepartureDate").val(prettyDate2); How would I adapt it to use set date?
  2. Hi, I have 2 inputs called ArrivalDate and DepartureDate using jQuery datepicker which needs to det the departure date at least one more day from the selected arrival date. All works fine, except when we reach the end of the month insted of the departure date rolling over to the next month it just +1's the date. Eg today its showing 31 April, which dosent exsist. $.datepicker.setDefaults({ changeMonth: true, changeYear: true, dateFormat: 'd/m/yy', firstDay: 1 }); var myDate = new Date(); var prettyDate = myDate.getDate() + '/' + (myDate.getMonth()+1) + '/' + myDate.getFullYear(); var prettyDate2 = (myDate.getDate()+1) + '/' + (myDate.getMonth()+1) + '/' + myDate.getFullYear(); $('#ArrivalDate').datepicker({ minDate: new Date(), onSelect: function(dateStr) { var min = $(this).datepicker('getDate') || new Date(); // Selected date or today if none $('#DepartureDate').datepicker('option', {minDate: min}); } }); $('#DepartureDate').datepicker({ minDate: new Date(), onSelect: function(dateStr) { var max = $(this).datepicker('getDate'); // Selected date or null if none $('#ArrivalDate').datepicker('option', {maxDate: max}); } }); $("#ArrivalDate").val(prettyDate); $("#DepartureDate").val(prettyDate2);
  3. I have 2 radio buttons. <input type="radio" name="toasted" id="toasted_sandwiches" value="Toasted Sandwiches" onclick="handleClick();" /> <input type="radio" name="toasted" id="toasted_paninis" value="Toasted Paninis" onclick="handleClick();" /> I want a function that only adds an event (in this case its spry validation) to what radio button is selected. Currently if the user clicks from one radio to the other, both spry events get called. function handleClick() { if (document.getElementById("toasted_sandwiches").checked == true) { var spry_toasted_sandwiches = new Spry.Widget.ValidationCheckbox("spry_toasted_sandwiches", {minSelections:3, validateOn:["change", "blur"]}); } else if (document.getElementById("toasted_paninis").checked == true) { var spry_paninis = new Spry.Widget.ValidationCheckbox("spry_paninis", {minSelections:3, validateOn:["change", "blur"]}); } }
  4. Hi, just tried it. It takes the size of the first image in img_wrapper and applies the class to the rest of the img_wrapper divs. So if the first image is landscape, the rest will be landscape regardless of the image size.
  5. I have a series of images in a div called .img_wrapper. I want to add a class to this div based on whether the image in the div is landscape or portrait. This is what I have come up with but doesn't work: $(".img_wrapper").each(function(){ var img = $(".img_wrapper img"); var div = $(".img_wrapper"); if (img.height() < img.width()){ div.addClass('landscape'); } else { div.addClass('portrait'); } });
  6. Can you give me an idea of how I would do this. The offer can be used on as many pages throughout the site as the user wants.
  7. Okay thanks for your replies. Basically what I am trying to achieve is the ability for the user to be able to edit a page on a website (this bit I have done, using 'update pages') and select from a drop down box an offer that appears in the SQL table 'offers'.
  8. They arn't. I just want to pull data from both to display on the same page.
  9. Hi, bit of a newbie question. I have a table called pages. I select all from this table. I need to also show the rows of another table called offers so the user can select an offer to display on this page. Question is, how do I select from both tables. pages table colums: ID Name Copy offers table columns: OffersID OffersTitle OffersDate OffersCopy OffersType OffersPrice I have tried variations of the below but does not work: SELECT * FROM pages WHERE id = '" . $id . "' LEFT JOIN offers
  10. Perfect, however is there an obvious reason why it wouldn't work in IE? Actually it does. I'm just being stupid!
  11. Hi, I have a input with a number as a value, say 1.55. I want to allow the user to be able to increase the number but not decrease it. Is this possible? Many thanks.
  12. Perfect! Thanks both of you. This worked!
  13. Hi, I currently have one table with a column called box, which will have values of 'one', 'two', 'three' etc. There will be 8 boxes to display on the site. The site needs to display the newest row according to column added (which will have the date added as a value). I am thinking of writing the code below to populate the 8 boxes: while($row1 = mysql_fetch_assoc(mysql_query("SELECT * FROM table WHERE box = 'one' ORDER BY added DESC LIMIT 1"))) { //echo box 1 } while($row2 = mysql_fetch_assoc(mysql_query("SELECT * FROM table WHERE box = 'two' ORDER BY added DESC LIMIT 1"))) { //echo box 2 } while($row3 = mysql_fetch_assoc(mysql_query("SELECT * FROM table WHERE box = 'three' ORDER BY added DESC LIMIT 1"))) { //echo box 3 } while($row4 = mysql_fetch_assoc(mysql_query("SELECT * FROM table WHERE box = 'four' ORDER BY added DESC LIMIT 1"))) { //echo box 4 } etc.... Is there a better way to streamline this? Many thanks
×
×
  • 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.