CMS and Javascript
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > CMS and Javascript




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    CMS and Javascript  
Tom


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-06 12:18 PM

Stefan:

Just following up ona thread from last week that I think got lost in the
shuffle.

On my MCMS template page with 'Switch To Edit' showing I have an input butto
n
with this code.

<input type="text" onkeypress=GoToSearch(event) class="search" />

Now in my incldued javascript code I have this but the browser only blinks
back at me and does not redirect me.

function GoToSearch (e)
{
if (e.keyCode == 13)
{
window.location.href = "http://www.yahoo.com";
}
}


Thisis what you wrote.  Can you tell me where the onunload event registered
you are referring to and javascript variable that needs to be set to prevent
this from happening.

Thanks  Tom



Hi Tom,

if I remember right (I don't have access to a CMS system at the moment)
there is an onunload event registered that would interact with your code.
And there should be a javascript variable that needs to be set to prevent
this from happening.
You might want to search the html/javascript code of MCMS for this to
implement a workaround.





[ Post a follow-up to this message ]



    Re: CMS and Javascript  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-06 06:15 PM

Hi Tom,

it does not seem to be a MCMS problem.
Cut and paste the code below into a test.html file and you will see the same
behaviour:

-----------
<form>
<input type="text" onkeypress=GoToSearch(event) />
<script>

function GoToSearch(e)
{
if(e.keyCode == 13)
{
document.location.href = "http://www.yahoo.com";
}
}

</script>

<a
href="java script:document.location.href='http://www.yahoo.com'">test2</a>

</form>
-----------

Using the test2 link it works. But using the enter key in the onkeypress
handler does not work.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights


"Tom" <Tom@discussions.microsoft.com> wrote in message
news:4DFAD9F9-FC15-4789-B71D-4A3A23E584B4@microsoft.com...
> Stefan:
>
> Just following up ona thread from last week that I think got lost in the
> shuffle.
>
> On my MCMS template page with 'Switch To Edit' showing I have an input
> button
> with this code.
>
> <input type="text" onkeypress=GoToSearch(event) class="search" />
>
> Now in my incldued javascript code I have this but the browser only blinks
> back at me and does not redirect me.
>
> function GoToSearch (e)
> {
> if (e.keyCode == 13)
> {
> window.location.href = "http://www.yahoo.com";
> }
> }
>
>
> Thisis what you wrote.  Can you tell me where the onunload event
> registered
> you are referring to and javascript variable that needs to be set to
> prevent
> this from happening.
>
> Thanks  Tom
>
>
>
>  Hi Tom,
>
> if I remember right (I don't have access to a CMS system at the moment)
> there is an onunload event registered that would interact with your code.
> And there should be a javascript variable that needs to be set to prevent
> this from happening.
> You might want to search the html/javascript code of MCMS for this to
> implement a workaround.







[ Post a follow-up to this message ]



    Re: CMS and Javascript  
Tom


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-06 06:15 PM

OK but  do you know the onunload event registered that would interact with m
y
code?  And is there a javascript variable that needs to be set to prevent
this from happening?

Thanks

Tom


"Stefan [MSFT]" wrote:

> Hi Tom,
>
> it does not seem to be a MCMS problem.
> Cut and paste the code below into a test.html file and you will see the sa
me
> behaviour:
>
> -----------
> <form>
>         <input type="text" onkeypress=GoToSearch(event) />
>         <script>
>
>         function GoToSearch(e)
>         {
>             if(e.keyCode == 13)
>             {
>                 document.location.href = "http://www.yahoo.com";
>             }
>         }
>
>         </script>
>
>         <a
> href="java script:document.location.href='http://www.yahoo.com'">test2</a>
>
> </form>
> -----------
>
> Using the test2 link it works. But using the enter key in the onkeypress
> handler does not work.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
>
> "Tom" <Tom@discussions.microsoft.com> wrote in message
> news:4DFAD9F9-FC15-4789-B71D-4A3A23E584B4@microsoft.com... 
>
>
>





[ Post a follow-up to this message ]



    Re: CMS and Javascript  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-06 06:15 PM

Hi Tom,

there is no onunload event in the sample below.
So this is not related to the onunload event.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights


"Tom" <Tom@discussions.microsoft.com> wrote in message
news:B4BA4E8D-2F15-49FF-82B1-FC289AD92578@microsoft.com...[vbcol=seagreen]
> OK but  do you know the onunload event registered that would interact with
> my
> code?  And is there a javascript variable that needs to be set to prevent
> this from happening?
>
> Thanks
>
> Tom
>
>
> "Stefan [MSFT]" wrote:
> 







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:23 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register