Jump to content

Spunky

Members
  • Posts

    344
  • Joined

  • Last visited

Everything posted by Spunky

  1. When I was using an event handler to run a function onclick for the checkbox (which would require putting onclick in each one) I got this code to work: function checkChecked(){ alert($('input[type=checkbox]:checked').val()); } but I instead would like something more like: $("input").click(function() {alert($('input[type=checkbox]:checked').val());}); But nothing is happening. I tried putting it inside a function with event handler just to make sure maybe it is never finding the code but the function should bring notice to it. It enters the function but still does nothing with the $("input").click(function(). Any suggestions?EDIT: Further testing reveals that if I click the checkbox again (unchecking it) it alerts 'undefined' twice, checking it again alerts the value 3 times..unchecking alerts 'undefined' 4 times..checking again alerts the value 5 times...so on and so forth..I'm confused.
  2. Thank you! With a little tweaking this will work beautifully!
  3. I've never seen it possible to get the text of the radio button, only the text of like a drop down box, but instead get an ID or value from a radio box. But I know JQuery does some awesome things. Or whatever library you are using. Would something like this work? function run(){buzTypeLength = document.getElementsByName('buztype').length;buzType = document.getElementsByName('buztype');for (var count=0;count<buzTypeLength;count+=1) { if(buzType[count].checked){ alert(buzType[count].value); }}} This would alert the value of the radio button, whichever one is checked. You could also instead assign an ID and alert that. If the value has another use and needs to be the number you gave it, you could use an if statement to assign the number to hair salon or car shop. Or the if statement could be directly connected to the count. There are lots of options of how to utilize the code once you know which radio button is selected. I know this branches away from the direction you were going but I'm not familiar with JQuery other than finding what I need and bending it to my uses. If it works for your purpose though it should be good.
  4. Event in your delete button: onclick="confirmDelete();" code for function: function confirmDelete();{ alert("DELETED!");}
  5. This requires using PHP to do, I have utilized similar code in a webpage I helped create here:http://www.michaelschoell.wowtah.com If you've never worked with PHP you'll not understand the code. I've worked a little with PHP but still I got a lot of help putting the code together. Generally what we did was decipher the number of posts it would put each page and then if that is exceeded it automatically generates a new page and puts the rest of the posts on that page until the limit is reached. These pages are automatically generated by the PHP code as the posts are added as normal. when you see something like '.php?=', it is a page that is automatically being generated usually using information stored in a database.
  6. I have a mixture of several checkboxes and groups of radio buttons and each of them have their own number value that we will call points. Anytime that a radio or checkbox is checked I want the value to be added to a total, to get total number of points. I know I can make an if statement that identifies when/if each one is checked and then identifies the value of that specific one..but that is redundant..although simple enough. Nevertheless I ran across some JQuery that allows you to check if any radio or checkbox has been checked which is great but then I'm not sure how to branch from that and get the value of it. $("#check1").click(function(){ if($('input[type=radio]:checked').length == 0){ alert("Please select one radio"); }})$("#check2").click(function(){ if($('input[type=checkbox]:checked').length == 0){ alert("Please select minimum one checkbox"); }}) Basically needing to find the value of the radio/checkbox that has been clicked and utilize it. Is this possible?
  7. Spunky

    RSS Help

    Ok so I actually have a question on this then since I really don't know much about even using RSS feeds on the consumer side; I've never subscribed to one or anything. Are RSS readers something that the user needs to download and install to their browser to be able to go around reading and subscribing to feeds? I just noticed the RSS button on the bottom left of this page, I tried clicking it, as a Chrome user it only showed me the XML file. So, would you say that coders shouldn't rely on RSS feeds to design a page? For instance, I am helping a Realtor with their website and part of it is showing their listings. They show them all and a quick summary on one page and then you can click on them individually to view all the details. Right now it is being coded by hand. There is a company she recently started using that creates a RSS feed of their listings and allows each individual one to be clicked on. It's fantastic this is exactly what she was doing but was more work. Problem is though, people who don't actually have a RSS reader or know anything about it (and the audience being people buying houses you're bound to run into a lot that don't know much about computers), will be out of luck right? Onto my second thought. How possible would it be to have what is in a RSS feed, or really, the XML document created, be entered directly into a database? I have more experience with databases and just entering the data into one for it to be loaded individually already makes more sense than hand coding for each house (still lots of copy and paste). I'm just trying to figure out an easier way for the Realtor to show her listings. My knowledge of RSS isn't big enough to sort out possibilities and such though.
  8. Ok, that is what I thought I might end up having to do. Thank you for the links. I will look into JavaScript. Yes, I know there are a couple of people(moderators) in these forums that seemingly have all the answers, that's why I am patient though waiting for a response.
  9. I would suggest asking this in the JavaScript forums. You can certainly accomplish this using JavaScript. One property I know of is .innerHTML. JavaScript is very nice about doing things dynamically. Judging by your general description of what you wish to accomplish, .innerHTML should do the trick.
  10. I have a div that is designed to change height depending on the content within. I don't want to set a solid height because I want it to be dependent on the content within. I'm trying to put an iframe into this div but the problem I am having...and based off some research a lot of people have... is that the iframe does not fill the container it is in and instead adds scrollbars. I have tried to change the overflow property to hidden of both the div it is in and for the body as I have seen suggested, but nothing is working. Does anyone have any suggestions or resources for iframes on how to solve these sort of issues?
  11. Well since I don't think there is a way to detect when the video is done you could try using JavaScript. http://www.w3schools.com/js/js_timing.asp
  12. What dsonesuk said just summarized my original solution before I mentioned JavaScript. I just hadn't spelled the rest out to you that you need to still make the width 100% just like you did with relative positioning. I was just suggesting using absolute instead of relative. Glad it works. I suggest downloading all major browsers onto your computer so that you can test. I believe there is also a site that will do this for you.
  13. After reading your original post I actually took a minute to think about what you're trying to accomplish. I've never tried to have an image expand with the div like that before, but it is an interesting concept. I know you said changing the width to 100% wasn't working but have you tried it with my idea? If you don't want to use the background CSS property than having it as an image seems like the best work-around. Yes, there is code that detects what browsers people are using, I've never used it before though either. For that matter there are JavaScript solutions as well I'm pretty sure. I don't think you could tell the CSS background property to be used depending on the browser unless you're using JavaScript anyways.
  14. If you simply change the z-index (I believe this requires absolute positioning) then I believe you should be able to get the <p> to go on top of the image without using relative position that creates that original space..
  15. Spunky

    div height alignment

    Oh I missed that part where you moved the background image. Very clever work-around! Thank you! I don't know why I didn't think of this, I was thinking maybe just dealing with putting it in the way background, but I didn't want it to be that long. So thank you!
  16. Going from a table-styled website to divs is not as simple as it sounds. div tags take a lot more CSS to match a desired look. It is especially difficult to get the bottom of columns to line up using div tags. I personally prefer div tags. Someone I know doesn't know the first thing to HTML prefers tables. Tables are more user friendly to rookies. Divs, although seemingly not as user-friendly, make for user-friendly code that is organized.
  17. My single experience with downloading files were .zip and simply linked to the file. I'd think though that if it could display, it would display the contents. For example you wouldn't be able to do this method for a .html file, clearly. I'm not sure what sort of file .gpx is though. Find out if there is a way to directly download a regular .html or .txt file, or even I'd imagine a .pdf would display in a new window. What goes in the parenthesis is what you want to open in a new window.This could be a page on your server, a direct url, or I'd even think an image. I read here that .zip files will download automatically. But another method will need to be used for other files I guess. It does give a PHP trick, there might be other methods though. I just found this with a simple Google search. http://webdesign.about.com/od/beginningtutorials/qt/html_dwnld_tag.htm I bet the people in the JavaScript forums could be of better help.
  18. <a href="mailto:youremailaddress">Email Me</a> This will automatically open your default email installed on your computer.
  19. As long as the notepad file where you put the HTML has the extension .html, it should appear in the browser.
  20. Spunky

    div height alignment

    The overflow in siteWrap fixed the issue of it completely holding it's contents. The header, with no float, is showing all the way to the left, causing the left column to completely disappear. With either float in the header, the left column is correctly placed but is only the size of it's contents. There's nothing to indicate it being larger though.
  21. Alright so I know this topic is a toughie. I've done all sorts of Googling on this and found all sorts of similar issues; ones that were close to mine I've attempted. Let me just show you my problem: The image header, left chrome section, the text section, and the green footer section are all left floating divs inside a single container div. I want the text div to adjust according to its content and the left chrome div to adjust with it. I know my code is essentially correct because take a look at what happens as I zoom out: ZOOM ONCEYou see that the left chrome div has expanded in height, properly scooting the green footer div into its proper place. ZOOM AGAINAs I continue the zoom out, the left chrome div continues to grow. To accomplish this I've set the html and body elements as well as the left chrome div and text div and the siteWrap div (that wraps everything) all to 100% height. It seems though that only thing that is following this is the left chrome div. I realize though that if there isn't much content, I do not want everything to expand that high. However, if I remove the height:100%; from the siteWrap div, the left chrome div shrinks to wrap its contents and the others scoots left. Honestly, think the issue comes down to not being able to get everything to completely be inside the siteWrap div. I know this because if I put a colored border around it, it doesn't quite wrap everything. So perhaps that is the core issue? Ultimately, I just need everything to align evenly on bottom if possible. Well, here is a mock-up of how the HTML is written: <div id="siteWrap"> <div id="sideColumn"> </div> <div id="header"> </div> <div id="mainContent"> </div> <div id="footer"></div> </div></div And the css: body{font-family:Calibri, Verdana;background:#000;}#mainContent {background-color:#FFF;padding:5px;float:left;width:970px;}body, html{height:100%;}#siteWrap {width: 1200px;margin-right: auto;margin-left: auto;display:box;height:100%;border:5px solid red;}#header {background-image: url(images/night_house1.jpg);width:980px;float:left;height:425px;position:relative;}#sideColumn {background-image: url(images/chrome.jpg);background-repeat: repeat-y;float: left;width: 220px;height:1000px;padding-top:25px;text-align:center;height:100%;}#footer{height:50px;background-color:#0F3;width:980px;float:left;}
  22. Spunky

    RSS Help

    Ok so yes, the feed will work in Firefox but only shows the code in Chrome. Why is that?
  23. Spunky

    RSS Help

    I don't want to add it anywhere. I want to see how RSS feeds work in the privacy of my own home. I am using Google chrome. What's the RSS reading software for? Probably to do something I am not interested in at this stage of my RSS learning experience. I accidentally recently closed the original page I was looking at asides from w3schools but here's a similar page that states a couple of simple steps to get a RSS feed working. .xml extension and all: http://pageaffairs.com/notebook/create-your-own-simple-rss-feed This is simply all I am trying to do right now and then with a working feed I can expand my knowledge. I will try this guy's steps and see if they work better. But it was similar instructions to this that I followed before my first post, to which I was trying to figure out why wasn't working when I posted.
  24. Spunky

    RSS Help

    Oops for some reason I thought it said .xml extension. Alright well I changed it, same issue, just shows the code. I didn't do anything with the .htaccess because I don't anything about it and research didn't help much except I did read that you should use the text/xml content header since it is written in xml. The server does support PHP but I imagine I have to do more than change the extension to make it a PHP file. Honestly, I just want some working code to see how this works. I can learn from working code. Can someone do that for me?
  25. Spunky

    RSS Help

    Okay, then I must be missing something. I copied the code of an RSS feed from the tutorial into a .xml file and linked to it. I uploaded it online to a site I have first because I am not sure if it requires a host, and it is not working. It just shows the code from the file. For example the code I am using is: <rss version="2.0"><channel><title>W3Schools Home Page</title><link>http://www.w3schools.com</link><description>Free web building tutorials</description><item><title>RSS Tutorial</title><link>http://www.w3schools.com/rss</link><description>New RSS tutorial on W3Schools</description></item><item><title>XML Tutorial</title><link>http://www.w3schools.com/xml</link><description>New XML tutorial on W3Schools</description></item></channel></rss> When I click on the link to the .xml file, it shows the code and says this on top of the page: This XML file does not appear to have any style information associated with it. The document tree is shown below.
×
×
  • Create New...