Posted by Jerry Stuckle on 10/18/06 03:18
Shelly wrote:
> I was a little too quick in replying. I have four buttons that should not
> open a new window and two that should. In my actual application I sent it
> to redir.php in the Javascript. Once there in redir.php, I test on which of
> the two buttons in the original page activated it and then send it to the
> proper page.
>
> The problem is that even though I only added the onclick to the two buttons
> for a new page, ALL six buttons go to redir.php AND open a new window. (I
> have the tests on the four other buttons in the original page.)
>
> Can you think of any reason why the buttons that do not have the onclick
> would execute the Javascript and go to redir.php? I placed the script just
> inside <body> and before <form>.
>
> Here is the actual code snippet for a button for a new page:
>
> <input type="submit" value="Click Here To" name="health"
> onclick="form_new_window(this)"
> style="color: #E1D2AA; border: 2px solid; border-color:
> #CD968F #610E08 #400906 #B14F46; background-color: #99160C; font-family:
> Verdana; font-size: 12px; display: block; height: 25px; width: 148px;
> font-weight: bold; margin: 3px; padding: 2px; padding-bottom: 5px;
> vertical-align: middle;" />
>
> and here is one for not a new page:
>
> <input type="submit" value="Click Here To" name="shop"
> style="color: #E1D2AA; border: 2px solid; border-color:
> #CD968F #610E08 #400906 #B14F46; background-color: #99160C; font-family:
> Verdana; font-size: 12px; display: block; height: 25px; width: 148px;
> font-weight: bold; margin: 3px; padding: 2px; padding-bottom: 5px;
> vertical-align: middle;" />
>
> and the Javascript is:
>
> <body>
> <script type="text/javascript">
> function form_new_window(button){
> var form = button.form;
> form.action = 'redir.php';
> form.method = 'POST';
> form.target = '_blank';
> return true;
> }
> </script>
> <form ....>
>
>
Shelly,
You're probably better off asking javascript questions in a javascript
newsgroup, don't you think? :-)
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|