SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Outside Providence
    0 Post(s)
    0 Thread(s)

    Help, this javascript code doesn't work!

    Hello! I'm driving myself a little nutty trying to figure out why javascript code that works perfectly fine on my laptop (Windows 2000) won't work on my customer's NT server. Here's the issue:

    I have some navigational tabs that should first save the current page and then redirect the user to the requested page. For example, one of the tabs says "search". So I want to save the current page and then redirect. I have this javascript function:

    function TheRedirect(page) {
    frm = document.TimeSheet;
    tsaction = "TheRedir";
    thepage = page;
    frm.the_action.value = tsaction;
    frm.the_redir.value = thepage;

    along with this form:

    <form action="TimeSheet_save.asp" name="TimeSheet">

    and the code for the search tab looks like this:

    <a href="#" onclick="TheRedirect('search')"><IMG height=22 src="images/tabs_search.gif" alt="Employee Search" border="0"></a>


    On my laptop, it works fine. But when I click on the tab on the NT server (running IIS 4.0) and IE 5.0, it runs all the lines up to the submit() and just doesn't submit the form. I verify each step of the way with an alert("made it here") and it tells me it got to each line of code, just fine.

    What am I doing wrong?

    TEAMWORK is the fuel that allows common people
    to produce uncommon results.

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Austin, TX
    0 Post(s)
    0 Thread(s)
    Hmm, it looks okay to me...maybe there's something else wrong.

  3. #3
    SitePoint Addict
    Join Date
    May 2000
    0 Post(s)
    0 Thread(s)
    Not sure if this makes any difference, but have you tried adding METHOD to your form tag. METHOD="post" or METHOD="get".

    I alos noticed that you are overlaying the action property in your script with another value thus your form will not go to the asp program. Try removing the line that populates the action field and see if that solves it.
    Last edited by requestcode; Jun 14, 2001 at 06:26.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts