Jump to content
Larry Ullman's Book Forums

Adrian56

Members
  • Content Count

    21
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Adrian56

  1. Thanks team. Nice to get help in context. Antonio, am I correct in thinking that 'toggle' latches i.e. it remembers which state it was at even if you are returning to the selected element having done multiple tasks in-between which affected the elements targeted by the 'toggle'?
  2. Sorry I was in the midst of formatting it in the form - hit a shift key or something - and the post was sent before it was ready or I had re-read it. The var filterB= $(this).attr([id]) was the Boolean I was trying to make work - I still can't but would love to know the error in my syntax so that in the future I can extract the 'id' attribute when in jQuery. The work-around was to use var filterB = $(this).attr('title'); instead.
  3. I was trying to filter the event using the id == 'sunnyvidicon' as my Boolean for 'it's a video'. I still can not get the syntax correct to set a variable var filterB= $(this).attr([id]) - when I set a flag it just told me the var was undefined. so.... I used var filterB = $(this).attr('title'); and it works perfectly! The code is below - any improvements welcome..... .....but I'd still love to know the syntax that gets a useable value out of $(this).attr([id]) - I'm sure I shall need it in the future. Thank you // alt Sunny functions $(document).ready(function(){
  4. In fact $(".sunny a [id=sunnyvidicon]") gets exclusivity in case I 'id' another thumbnail
  5. I've found a selector that works for the camera icon $(".sunny a [id]") I just need the syntax for not([id]) ie excludes $(".sunny a [id]")
  6. Your second point: I only have Safari. I guess I need to try more browsers!
  7. On my working page, the viewer selects the large picture by clicking on the small images(thumbnails) lined up below. One of those thumbnails is a camera icon & link to the iFrame(an embedded video) which replaces the large picture on the web page. To change between still pictures you just click on the next small image - but to leave the iFrame you need to click on the camera icon a second time i.e. it toggles the visibility of the iFrame and main picture element. I am trying to change the UI so that just clicking on the next thumbnail toggles the visibility of the two main elements as
  8. I have set up a picture gallery in which one of the elements is a video in an iFrame. It worked and I was happy until someone said "Why do you have to hit the camera icon again to escape from the video?' Obvious and exactly what I strive towards - really simple UI. I tried to code the simpler interface. I have proved sections of my code by 'commenting out' individual lines. I believe it is the selector filtering which is failing me - AND IT'S DRIVING ME CRAZY! Please can you tell me 'the error of my ways, thank you. The HTML : <div class="twocol_pad30"> <iframe id
  9. I didn't have the terminology to have successfully found that link! The form now behaves totally as expected and the UI has an elegant simplicity, thank you
  10. I have been using page.html#goto to navigate to a specific location and page.html?name=value to transfer values between pages. What I have failed to do is combine both. page.html#goto?name=value and page.html?id=goto&name=value have failed for me. I'm sure the solution is simple - I just cannot find it! Help please
  11. Okay all that you have said in this and 'Trying To Return To Previous Page From A Form' has worked perfectlybut... below is the source code from the formpage being 'posted' to itself. Every thing looks as though it should be fine but the value of the message field 'dddd' is not displayed. Have I hit the edge again - I'm really not doing very well with this message field! <form method='post' action='formpage.php?urlinform=http://localhost:8888/Any_root/anotherpage.html&email=&subject=sssss&message=dddd'> <fieldset><legend>Your Contact Informatio
  12. Absolutely spot on!! I'd added spaces/breaks at that point in the coding for readability. Works perfectly now, thank you. Now I can get on with making the form sticky.
  13. I am trying to confirm entries in the form below using strlen but am stymied by a strange bug/error - in check for entries in subject and message fields else if((strlen($_POST['subject']) == 0) || (strlen($_POST['message']) == 0)) the first condition works perfectly ($length=0) but strlen($_POST['message'] returns $messagelen=5 or more even when nothing is entered?! When you first click in the textarea the cursor positions beyond the start point - which is probably causing the error, but why? Thank you for any help. <?php function spamcheck($field) { //filter_var() sa
  14. <?php $returnurl = htmlspecialchars($_SERVER['HTTP_REFERER']); if(!preg_match('/formpage.php/', $returnurl)) { echo "<p><a href=\"$returnurl\"><img id=\"lftarrow\" src=\"images/LhArrow.graphic.png\" alt=\"Previous page\">Return</a></p>"; } else { echo "<p><a href=\"index.html\"><img id=\"lftarrow\" src=\"images/LhArrow.graphic.png\" alt=\"Home page\">Return to Home page</a></p>"; } ?> I am using this code to provide a path back to the calling page from the page with a form. My problem is that the form ca
  15. Stuck on the Login exercise in the last section of chapter 15. I've downloaded 'jquery-1.9.1.min.js' and created the calculator both with and without the 'alerts' but just cannot get the 'ajax' exercise to run. I've walked away (Larry's best solution) and usually come back to find a pesky typo has wasted days of my life but not this time. In desperation I have cut and pasted the scripts from the support pages - initially piece-meal to see where an error could be and finally in toto just to get the thing to run. I get the form up on the page with the initial error messages i.e.
  16. Okay solved and it is embarrassingly obvious if I've got this correct. On page 121 is '/applications/mamp/library/bin/mysql' which is what I entered and got the mysql prompt. On page 122 is 'mysql -u username -p' so I entered '-u username -p' after the mysql prompt and got nowhere! Found '/applications/mamp/library/bin/mysql -u username -p' in manual and subsequently at the bottom of page 122 in the screenshot - happiness!! Hope this thread saves somebody else a lot of time.
  17. Ok, I've just proved I'm a 'Newbie"<br /><br />I have been searching the MYSQL manual and re-reading the errors. I get the initial mysql-manual SQL queries to run but if I query anything else I get "access denied ''@localhost"<br />I'm guessing that is a privileges issue - help please
  18. I use a default installation of MAMP on a macbook running OS X. I can carry out the exercises in MyPHPAdmin but when trying them from the 'Terminal' application I had issues : I can open and sign-in and enter the queries as per chpt5 but I get no response i.e. the tables (part tables) shown in the screen shots do not appear in the window. Neither am I getting any error messages. Any ideas what blindingly obvious thing I'm missing. Thank you Incidentaly, entering a semi-colon after the SQL commands in the 'Terminal' window resulted in 'syntax error' statements.
  19. Margaux Thank you. I went away and looked at a MySQL manual and found this: "If you set a column to the value it currently has, MySQL notices this and does not update it" (http://dev.mysql.com/doc/refman/5.5/en/update.html) "An integer greater than zero indicates the number of rows affected or retrieved. Zero indicates that no records were updated for an UPDATE statement, no rows matched the WHERE clause in the query or that no query has yet been executed. -1 indicates that the query returned an error or that, for a SELECT query, mysql_affected_rows() was called prior to calli
  20. Hi New to PHP but have got to the end of chapter 12 and all is great -almost. I was further playing after successfully creating/checking 'edit_entry.php' (script 12.9) and this time hit the 'submit' button before any change had been made to an entry. This triggered the error 'Could not update entry because: ...' i.e. mysql_affected_rows($dbc) = 0 Intrigued I played some more Any editing resulting in change successfully runs. No editing returns the error. Any editing returning to the original text returns the error. I'm having difficulty understanding w
×
×
  • Create New...