Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Lv 2863 points

petree

Favorite Answers48%
Answers85
  • How do I make a div move with the scrolling of the page (position:fixed) that's inside a table?

    Ok, so, I have a div named "sidebarHolderDiv" that's inside a table named "sidebarHolderTable". I've searched Google and have looked at other people's questions about moving an element with the page as the page scrolls, but none of them seem to answer my question.

    I want to make the div move down or up with the page. But here's the thing: the div does not start at the top of the page, and it does not end at the bottom of the page. It is on the left side of the table, and the div starts about 1/4 of the way down the page. The div is the sidebar and contains a bunch of links and stuff. So, I would like to make the div start "scrolling" **When the page reaches it** and to make it scroll with the page up or down. However, I don't want to move the div outside of the table it's in. I would like the div to stop scrolling when it reaches the end of the table (both the top of the table and the bottom).

    So, is there a way to make boundaries for the scrolling div or something? I tried using position:fixed, but that moves the div outside of the table, and it just scrolls with the page all the way up or down, ignoring the fact that the div is inside a table. And, if at all possible, I would like to NOT use JavaScript. But, if it is necessary, I will.

    Thanks in advance! (:

    2 AnswersProgramming & Design1 decade ago
  • Javascript: Display a Confirm message if any link on the page is clicked?

    I am looking for a Javascript code that will make it so if any link on the page is clicked, it will display a Confirm box asking them if they really want to navigate away from the page. I don't want to have to write an onClick event on every single link on the entire page, so I am wondering if it is possible to make it happen for all links. If a user navigates away from the page, they will lose all data they have inserted in the form.

    I cannot find a solution to this anywhere on the web, and I have no clue how I would do this. Can someone please help? Thanks in advance =)

    1 AnswerProgramming & Design1 decade ago
  • Javascript Onkeypress is one action late. How do I fix this?

    I have a form, and I am trying to make it so that when someone inputs text into a field, it also shows up in another field as if they were typing in both fields at the same time. But when I use onKeyPress to make both values the same, it is always one character late.

    For example, if they were to type in "12345" in one field, the other field would have a value of "1234". Then, if they added a "6" to that field, making it "123456", then the other field would be "12345". It is always one character late, and I don't know how to fix this. I know it's not a problem with my browser, because I tried it with Mozilla Firefox, Internet Explorer, and Safari, but it always does the same thing.

    So here is my javascript code:

    function addressRecip()

    {

    var addressValue = document.form1.address.value;

    document.form1.raddress.value = addressValue;

    }

    Then, in the form, I have:

    <form name="form1" id="form1">

    <input type="text" id="address" value="" size=30 onKeyPress="addressRecip()">

    <input type="text" id="raddress" value="" size=30>

    </form>

    I also tried using onKeyDown and onKeyUp but they have the same results. Thanks in advance! =]

    1 AnswerProgramming & Design1 decade ago
  • I need help with this PHP script for my search engine. Please!?

    Okay. So in my search engine, for each array, there is a link to the page, where the page is located, and a description (a section from the body of the page) of the page.

    By the way, I didn't just make a bunch of keywords and titles and links and descriptions. I have over 3000 files on my website. I wouldn't make keywords and titles and links and descriptions for every single one. It actually searches and sees if the keyword is in the body of any of the files on my website. If it has the keyword in it, it displays that page in the search results.

    I have made a string called '$keyword' which is the word that the user searches for. Well actually, the keyword they insert into the form is called '$keywordin' and the actual word is called '$keyword' but that is only so I can tell the difference between the two. And it also makes sure there isn't two descriptions showing up. But I did say that $keywordin=$keyword; so they are the same thing.

    That's the same thing with '$desc' and '$rdesc'. They are just different versions of the same thing. But they both have their own reason for being there. So just go along with me.

    But anyway, in each description (which I have named $desc), I have told it that if it finds the inserted keyword anywhere in the description, to highlight the word. That works fine. But the problem is it capitalization-sensitive. So, I need help with this script I made to make it not capitalization-sensitive. Here is the script I am trying to use to do this:

    //if the first letter of the inserted keyword isnt capitalized, make sure to

    //highlight any $keywords in the $desc that do have their first letter capitalized

    //along with the ones that dont

    if(ucwords($keywordin) != true){

    $uppercase = ucwords($keyword);

    $replacek = "$uppercase";

    $replacementk = "<b><font style='background-color: yellow'>$uppercase</font></b>";

    $stringk = "$rdesc";

    $rdesc = ereg_replace($replacek, $replacementk, $stringk);

    }

    if(ucwords($keywordin) == true) {

    strtolower($keywordin);

    $lowercase = strtolower($keyword);

    $replacek = "$lowercase";

    $replacementk = "<b><font style='background-color: yellow'>$lowercase</font></b>";

    $stringk = "$desc";

    $rdesc .= ereg_replace($replacek, $replacementk, $stringk);

    }

    The first part of the script works (the part that says: if(ucwords($keywordin) != true){ blah blah blah). If they insert a keyword that has a lowercase first letter, then it will highlight the keywords that have capitalized first letters along with those that have lowercase first letters..

    But if they insert a keyword with a capitalized first letter, it only highlights the keywords with capitalized first letters. It doesn't capitalize the keywords with lowercase first letters. But the second part of the script (if(ucwords($keywordin) == true) { blah blah blah) is supposed to make sure that it capitalizes all of them.

    Can someone please help me?

    2 AnswersProgramming & Design1 decade ago
  • How do I align my submit button image in Internet Explorer?

    I have a search engine for my site and I decided to make the search button an image. It works fine (it even has a rollover effect) but in Internet Explorer, the image does not align. I use Firefox because it is way better in my opinion, but I want to make it work for Internet Explorer too for other people when they visit my site.

    The code I use for my search form is this:

    <form name="form1" method="post" action="../search.php" align="right">

    <table width="200" cellspacing="0" cellpadding="0" align="right" valign="middle">

    <tr>

    <td width="36%" valign="middle">

    <div align="center">

    <input type="text" name="keyword">

    </div>

    </td>

    <td width="64%" valign="middle">

    <input type="image" valign="middle" src="../pictures/search-box.jpg" onmouseover="this.src=search-box2.jpg" onmouseout="this.src=search-box.jpg" value="Search" alt="Search" title="Search">

    </td>

    </tr>

    </table>

    </form>

    You probably don't understand my problem yet. Let me explain:

    In Mozilla Firefox, the search box and the submit button align in the center of the box vertically and horizontally (vertically = valign, horizontally = align) and it is very neat. In Internet Explorer, they align horizontally (align="center") but even though I have valign="middle" they don't align together vertically. The search box is in the middle vertically, but the Submit button (the image) is up at the top of the table instead of in the middle right next to the search box like it should be. It's very annoying.

    Please tell me how I can make it so both the search box and the submit button image will line up in the middle of the table together. I have already tried everything I know, including valign and setting the height of the table.

    2 AnswersProgramming & Design1 decade ago