Jump to content

McMaster

Members
  • Posts

    55
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    United Kingdom
  • Interests
    Music, Web Design, Drawing Cartoon Strips and Writing.
  • Age
    26

McMaster's Achievements

Member

Member (2/5)

0

Reputation

  1. Josh! Thank you very much That worked a treat for me. Appreciate that.
  2. Hi! I have a javascript function that loops through certain elements on a page and add's the elements up. For example, element 1 value is 20 and element 2 value is 10. The alert in the loop should be showing 20 and then 10, but it just shows undefined20.00 and the stops? Here is my function... function updatePrice(couponPrice,couponQuanity,whichPrice,howMany) { var price = couponPrice * couponQuanity; var x; var ptotal; var myItems = new Array(); document.getElementById(whichPrice).innerHTML=price.toFixed(2); for (x=1;x<howMany+1;x++) { myItems[x] = document.getElementById('totalPrice' + x).innerHTML; ptotal+=myItems[x]; alert(ptotal); } }
  3. Hi! I've recently bumped in to this strange problem that is doing my head in and so I thought I'd post here in the hope that someone can help me out here. I have a few images on the home page of my website and when I hover over these images a nice opacity appears over the image. The problem I am having is that when I mouse over on certain images, the main image seems to jump to the right a couple of pixels. Here is the link so you can see what I mean... http://tinyurl.com/ckfo7mn The 2 images that jump (very top one and very bottom one) aren't linked, whereas the image inbetween does have a link and causes no problems at all? Hmmm... Can anyone help shed some light on this as I'm racking my brains here. Thanks
  4. Do you know where I could find a function to do this? I'm really strugglinh here.
  5. I don't suppose you could have some sort of function that could help me out here. I've bee racking my brains here with this.
  6. Okay guys, On to my hated regular expressions lol. I'm having a problem here. I've been building a comment system and I want links to be converted to actual clickable URL's. I have this working but only if http:// is within the comment the user has posted. Here is my expression. return preg_replace('!(((f|ht)tp://)[-a-zA-Z?-??-?()0-9@:%_+.~#?&;//=]+)!i', '<a href="$1">$1</a>', $text); Anything I can do here so it accepts both http:// and just www (without http) Thanks in advance ATB
  7. Had a brainwave but probably not right... Wouldn't it be possible to use ctype_alpha() along with ctype_digit() ?
  8. Hi, Recently I've been working on a comment system but I'm experiencing a problem. People can post with just spaces and not actual characters / numbers. Is there any way around this? Thanks in advance. ATB
  9. Well, when I click on the text input field and enter some text and then view the source code, the value of "human" is still set to 0, even when I refresh the source page.
  10. I am trying to change the value of the "human" field to 1 when the name field is onfocus but I cannot seem to get it to work. Here is the code I have for it... <form action="process.php" method="POST"> <input type="text" name="name" onfocus='document.getElementById("human").value="1"' /> <input type="hidden" name="human" id="human" value="0" /> <input type="submit" value="go" /> </form> Any help appreciated.
  11. What query is running through the $result2 variable?
  12. This normally appears when a variable isn't set properly so you may need to edit the source (well, the line with the error to be precise). Another solution is to suppress warnings. Add this line of PHP code to the source... error_reporting (E_ALL ^ E_NOTICE);
  13. It clearly says in the original users post "I've made a webpage that displays data taken from SQL" .. maybe MySQL/MSSQL who knows but I am pretty sure they got the idea of what I was saying. Nesting tables is not bad practice at all although it can be tricky if you nest a lot as there will be a lot of code. A nested table can position just as good as CSS so wherever you got the idea of CSS is for positioning and not tables is a lot of crap lol.
  14. Your new response makes even less sense, especially since I'm pretty sure the OP isn't using MySQL, and this is a topic about html/css not sql. The user is reading records from the sql database to feed the table... check their original code.
  15. <table> <tr> <td> <!-- THIS IS TABLE 1 (LEFT) --> <table border="1" BORDERCOLOR=Black style=width:300px >'; <tr> <th bgcolor = "LightBlue">Name</th> <th bgcolor = "LightBlue">Sales Volume</th> <th bgcolor = "LightBlue">Year</th></tr>'; </tr> <?php while($row = sqlsrv_fetch_array($results, SQLSRV_FETCH_ASSOC)) { echo '<tr>'; echo '<td >' .$row['NAME'].'</td>'; echo '<td>' .$row['SalesVolume'].'</td>'; echo '<td>' .$row['Year'].'</td>'; echo '</tr>'; } ?> </table> </td> <td> <!-- THIS IS TABLE 2 (RIGHT) --> <table border="1" BORDERCOLOR=Black style=width:300px >'; <tr> <th bgcolor = "LightBlue">Name</th> <th bgcolor = "LightBlue">Sales Volume</th> <th bgcolor = "LightBlue">Year</th></tr>'; </tr> <?php while($row = sqlsrv_fetch_array($results, SQLSRV_FETCH_ASSOC)) { echo '<tr>'; echo '<td >' .$row['NAME'].'</td>'; echo '<td>' .$row['SalesVolume'].'</td>'; echo '<td>' .$row['Year'].'</td>'; echo '</tr>'; } ?> </table> </td></tr> </table> Notice how I put 2 tables in 1 so now you have a left and right column. No float:left
×
×
  • 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.