Templates & Javascript Question

I'm working on a site where I'd like to make use of this
nifty technique I
found on the Project VII site to control the down-state image
in a simple
navbar:
http://www.projectseven.com/support/answers.asp?id=126
I want to put the navbar in a non-editable region of the
template, but I'm
not sure how to do this and keep the flexibility to specify
the down-state
of the various buttons as I create new pages. Can I simply
place the navbar
in a non-editable region and put the script in an editable
region then
simply alter the script as needed?
Thanks,
John

Thanks, Alan. So I'd end up with something like this?
<!-- TemplateBeginEditable name="downState" -->
<script type="text/javascript">
<!--
//set the down image name for this page
var g7="myImageName";
function P7_downImage(){ //v1.0 byPVII
//set the down image name convention
var g,dd="_down";
if((g=MM_findObj(g7))!=null){gg=g.src;
tu=gg.lastIndexOf(".");
g.src=gg.substring(0,tu)+dd+gg.substring(tu,gg.length);}
//-->
</script>
<!-- TemplateEndEditable -->
</head>
John
"Alan" <[email protected]> wrote in
message
news:C379A352.2E3B2D%[email protected]..
> you can put the nav bar in a locked region no problem.
>
> just put the script in an editable area in the head
section, so you can
> edit
> var g7="myImageName";
> on the different pages.
>
> --
> Alan
> Adobe Community Expert, dreamweaver
>
>
http://www.adobe.com/communities/experts/
>
>
>

Similar Messages

  • Additional Pageflow - JavaScript Questions

    I was hoping someone (bea employee???) could answer a couple more JavaScript questions
    for me?? First one is how do I (can I) do something similar to what John Rohrlich
    (see below) suggested inside a netui-data:grid tag? Among other things that didn't
    workI tried this:
    <netui-data:anchorColumn action="deleteUsr" title="">
    <netui:anchor action="deleteUsr" onClick="return confirmDelete('user', {container.item.usr_nm}
    ); return false;">
    Drop
    <netui:parameter name="userToDrop" value="{container.item.usr_nm}" />
    </netui:anchor>
    </netui-data:anchorColumn>
    From this snippet you might be able to guess what my next question is. Is there
    a way to render a variable inside the onClick value? I have tried a number of
    things to no avail, stuff like:
    <netui-data:getData resultId="thisId" value="{container.item.userId}" />
    <netui:anchor action="dropUser" onClick="return confirmDelete('user', '<%=(String)pageContext.getAttribute("thisId");%>');
    return false;">
    BTW this is in a repeater I have else ware in my code. I would really like to
    convert everything to grids to get the sorting, filtering and paging capabilities.
    I would like to be able to pass the parameter to my JavaScript so the user has
    a little more info on what he is dropping - here is the script:
    function confirmDelete(){
    //arg 1 would be the record type i.e. "user"
    //arg 2 would be the key identifier i.e. "Fred"
    var question = "Are you sure you want to drop this record?";
    var argNum = confirmDelete.arguments.length;
    if (argNum == 1){
    question = "Are you sure you want to drop this "+confirmDelete.arguments[0]+"?";
    else if (argNum == 2){
    question = "Are you sure you want to drop the "+confirmDelete.arguments[0]+"
    "+confirmDelete.arguments[1]+"?";
    return confirm(question);
    Thanks,
    John
    "John Rohrlich" <[email protected]> wrote:
    John,
    If you want to put up a confirm dialog before calling an action from
    an
    anchor it is done as follows.
    Here is an example from code of mine that deletes a customer order, if
    the
    user confirms the delete. I pass the order id as a parameter.
    - john
    Here is the JavaScript -
    function confirmDelete() {
    if(confirm('Continue with order delete?'))
    return true;
    else
    return false;
    Here is a sample anchor tag -
    <netui:anchor action="requestToDeleteOrder" onClick="return
    confirmDelete(); return false;">
    Delete
    <netui:parameter name="orderId" value="{container.item.orderId}"/>
    </netui:anchor>

    Thanks Eddie, I looked at that reply when you gave it but it didn't give me enough
    to go on. You suggested:
    <netui-data:expressionColumn title="Show Alert" value="<a href='javascript:alert(12345);return
    false;> {container.item.customername}</a>" />
    I started a new thread after that one - What is the best way to call a pageflow
    action from JavaScript? Guess I was sort of beating around the bush on this. Can
    you see where I was going? If I use the method you describe above how do I call
    my dropUser pageflow action if the user confirms the drop in the java dialog?
    Thanks, John
    Eddie O'Neil <[email protected]> wrote:
    John--
    You might check an earlier response about this from a different thread.
    "Re: Confirmation dialog w/netui:anchor and netui-data:anchorColumn"
    on
    1/28/2004.
    It's possible to do though not intentional; the 8.1 grid wasn't
    really designed to do this.
    The NetUI team is certainly aware of the limitations with using this
    version of the grid and is working to address said limitations with a
    much improved tag set in v9. If you have additional feedback on
    features you'd like to see, please feel free to send them along --
    including your top 10 (or whatever!) reasons not to use the grid. :)
    In the meantime, depending on what you need to do, the repeater may
    suit your needs well, though you may need to do some work to implement
    sort / filter logic.
    Hope that helps.
    Eddie
    John H wrote:
    So what you are telling me is that a cant do somthing as simple aspop up a confirmation
    when using a grid? That really stinks if that is the case. I am thinkingI need
    to write up "Top ten reasons not to use a grid." Thanks for the repeatercode.
    "John Rohrlich" <[email protected]> wrote:
    John,
    The grid doesn't support event handlers like onClick but I have included
    code here to show you how to pass parameters to your javaScript event
    handler when using the repeater. Let me know if you have any questions
    about
    the code.
    Most of the code is standard repeater code. The interesting code is
    below
    (also see my code comments). I have also attached the full jsp fileand
    the
    jpf file you need to try my example.
    - john
    <script language="JavaScript">
    function confirmDelete(phrase) {
    if(confirm(phrase))
    return true;
    else
    return false;
    </script>
    <netui-data:repeater dataSource="{pageInput.orders}" defaultText="No
    orders">
    <netui-data:repeaterItem>
    <tr valign="top">
    <td>
    <netui:label value="{container.item.orderId}"
    defaultValue=" "></netui:label>
    </td>
    <!-- You can't bind data to onClick so you need to build
    a
    string. -->
    <!-- The string will be the function call with the
    parameters you are passing. -->
    <!-- Here is the building of the string -->
    <netui-data:getData resultId="orderId"
    value="{container.item.orderId}" />
    <%
    String somePhrase = "Do you want to delete item " +
    pageContext.getAttribute("orderId") + "?";
    String foo = "return confirmDelete(\'" + somePhrase+
    return false";
    %>
    <td>
    <netui:anchor action="requestToDeleteOrder"
    onClick="<%=foo%>" >
    Delete
    <netui:parameter name="orderId"
    value="{container.item.orderId}"/>
    </netui:anchor>
    </td>
    </tr>
    </netui-data:repeaterItem>
    "John H" <[email protected]> wrote in message
    news:[email protected]...
    I was hoping someone (bea employee???) could answer a couple moreJavaScript questions
    for me?? First one is how do I (can I) do something similar to whatJohn
    Rohrlich
    (see below) suggested inside a netui-data:grid tag? Among other thingsthat didn't
    workI tried this:
    <netui-data:anchorColumn action="deleteUsr" title="">
    <netui:anchor action="deleteUsr" onClick="return confirmDelete('user',{container.item.usr_nm}
    ); return false;">
    Drop
    <netui:parameter name="userToDrop" value="{container.item.usr_nm}"/>
    </netui:anchor>
    </netui-data:anchorColumn>
    From this snippet you might be able to guess what my next questionis. Is
    there
    a way to render a variable inside the onClick value? I have trieda
    number of
    things to no avail, stuff like:
    <netui-data:getData resultId="thisId" value="{container.item.userId}"/>
    <netui:anchor action="dropUser" onClick="return confirmDelete('user','<%=(String)pageContext.getAttribute("thisId");%>');
    return false;">
    BTW this is in a repeater I have else ware in my code. I would reallylike to
    convert everything to grids to get the sorting, filtering and pagingcapabilities.
    I would like to be able to pass the parameter to my JavaScript sothe
    user has
    a little more info on what he is dropping - here is the script:
    function confirmDelete(){
    //arg 1 would be the record type i.e. "user"
    //arg 2 would be the key identifier i.e. "Fred"
    var question = "Are you sure you want to drop this record?";
    var argNum = confirmDelete.arguments.length;
    if (argNum == 1){
    question = "Are you sure you want to drop this"+confirmDelete.arguments[0]+"?";
    else if (argNum == 2){
    question = "Are you sure you want to drop the"+confirmDelete.arguments[0]+"
    "+confirmDelete.arguments[1]+"?";
    return confirm(question);
    Thanks,
    John
    "John Rohrlich" <[email protected]> wrote:
    John,
    If you want to put up a confirm dialog before calling an action
    from
    an
    anchor it is done as follows.
    Here is an example from code of mine that deletes a customer order,if
    the
    user confirms the delete. I pass the order id as a parameter.
    - john
    Here is the JavaScript -
    function confirmDelete() {
    if(confirm('Continue with order delete?'))
    return true;
    else
    return false;
    Here is a sample anchor tag -
    <netui:anchor action="requestToDeleteOrder" onClick="return
    confirmDelete(); return false;">
    Delete
    <netui:parameter name="orderId" value="{container.item.orderId}"/>
    </netui:anchor>

  • I downloaded bundle for ms office only to realise its just a template.my questions are can i be refunded and how can i get the right msoffice because am in need of it badly

    i downloaded bundle for ms office only to realise its just a template.my questions are can i be refunded and how can i get the right msoffice because am in need of it badly

    You can request a Mac App Store refund at reportaproblem.apple.com
    You can buy Microsoft Office at office.microsoft.com

  • Please help me...Javascript question

    Hi everyone,
    what i am trying to do is..
    EX:
    TABLE: EMP
    empno empname sal entered_by
    1 john 1000 user1
    I have a form on the table EMP.The users want to enter the same record again(because mutiple users enter the same record) but want an alert message when they hit the create button like.. Eg:
    when user2 is trying to enter this data..
    empno: 2 (generated by sequence)
    empname: john
    sal: 1000
    he wants to see an alert message like: THE Record is Already exists in the database which was entered by USER1 (But he can enter the same record)
    what i did is.. I have a javascript which calls the application process (PL/SQL) where it check whether the data entered is already there in the database and returns back an alert message like this:
    JAVASCRIPT:
    ==========
    <script language=javascript>
    function  f_insert_record()
            var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=INSERT_RECORD',0);
            get.add('P2_EMPNAME',html_GetElement('P2_EMPNAME').value);
            get.add('P2_SAL',html_GetElement('P2_SAL').value);
            gReturn = get.get();
            var a = gReturn.split("|");
            if(gReturn)
                if (a.length > 0) {alert(a[0]);}
            else
                null;
    </script>APPLICATION_PROCESS
    ===================
    DECLARE
       l_error   VARCHAR2 (4000);
       V_NAME VARCHAR2(1000);
       V_MSPR_ID NUMBER(15);
       I NUMBER;
       V_MYNUM STRING_OBJ := STRING_OBJ();
    BEGIN
      FOR C1 IN (SELECT DISTINCT entered_by ENTERED_BY_USER_NM 
    from emp 
    WHERE  
      empname = :P2_EMPNAME
      AND sal  = :P2_SAL
      ) LOOP
        V_MYNUM.EXTEND;
        V_MYNUM(V_MYNUM.COUNT) := C1.ENTERED_BY_USER_NM;
      END LOOP;
      V_NAME := NULL;
      l_error := NULL;
      FOR I IN V_MYNUM.FIRST..V_MYNUM.LAST LOOP
        --dbms_output.put_line(V_MYNUM(I));
        V_NAME := V_NAME || '   ' || V_MYNUM(I);
      END LOOP;
      IF V_NAME IS NOT NULL THEN
        l_error := 'The record already exists in the database which was created by '||V_NAME;
      END IF; 
      HTP.PRN(l_error);
    END;everything works fine...when i have a ONBLUR event on the SALARY field.
    But i want the same thing to be achieved with the ONCLICK event on the CREATE button (Template based button).
    The code i have shown over here is just an example...But the requirement is the same..Multiple Users can enter the same record but they want to see an alert message like this record was entered by USER1,USER2.
    The only think i am not able to figure out is the ONCLICK event on that create button.
    I tried like this Target: URL
    javaScript:(f_insert_record();doSubmit('CREATE');)
    I am not getting the alert message.
    Please help me to solve this
    thanks
    phani

    damn it! Those little quotation marks.....
    I already did figure it out awhile after I posted my question
    Thanks anyway!

  • OT-javascript question

    I'd like to have a javascript image gallery with controls
    that look like that:
    < 1 | 2 | 3 | 4 | 5 >
    All images preload, and clicking on the numbers display the
    corresponding image, without reloading
    the page.
    I have had no problem making the numbers work, but I can't
    figure out how to make the previous and
    next arrows work. I don't want them to be Form buttons, just
    links that call a function that will
    decrement or increment a variable and at the same time change
    the image to the new variable value
    (all my images are called "1.jpg" "2.jpg" "3.jpg" etc. so
    this should be fairly simple...)
    Yet I could not find a simple example of this on the web...
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

    > Beyond this, I have a general question: your script is
    so simple, I don't
    > understand why I would ever use Macromedia's set text of
    layer behavior
    > (or swap image behavior for that matter) which are way
    more complicated.
    > My question is why are these behaviors so complicated
    while your script
    > which just changes the source of an image by its id is
    so incredibly
    > simple. Is there a catch?
    Mick's script is optimized for you and your specific
    application. MM's
    scripts are generalized to cover all bases - and to do error
    checking.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "(_seb_)" <[email protected]> wrote in message
    news:[email protected]...
    > Mick White wrote:
    >> (_seb_) wrote:
    >>
    >>> I'd like to have a javascript image gallery with
    controls that look like
    >>> that:
    >>>
    >>> < 1 | 2 | 3 | 4 | 5 >
    >>>
    >>>
    >>> All images preload, and clicking on the numbers
    display the
    >>> corresponding image, without reloading the page.
    >>> I have had no problem making the numbers work,
    but I can't figure out
    >>> how to make the previous and next arrows work. I
    don't want them to be
    >>> Form buttons, just links that call a function
    that will decrement or
    >>> increment a variable and at the same time change
    the image to the new
    >>> variable value
    >>> (all my images are called "1.jpg" "2.jpg"
    "3.jpg" etc. so this should be
    >>> fairly simple...)
    >>>
    >>> Yet I could not find a simple example of this on
    the web...
    >>>
    >>
    >> CURRENT=1 //global
    >> function next(max){
    >> document.images["gallery"].src=CURRENT+".jpg";
    >> CURRENT++;
    >> if(CURRENT>max)CURRENT=1;
    >> }
    >>
    >> Similarly with "previous"
    >> CURRENT--;
    >> if(CURRENT<1)CURRENT=max;
    >>
    >> Mick
    >
    > thanks a lot Mick.
    > I have a few questions.
    > I assume ["gallery"] can refer to the image ID, which in
    my case is
    > "mainImg"
    >
    > So I used:
    > document.images["mainImg"].src=CURRENT+".jpg";
    >
    > and it sort of works, I also tried
    >
    > document.images.mainImg.src=CURRENT+".jpg";
    >
    > and it sort of works too.
    >
    > It works as long as I do not use the numbers in between
    the previous and
    > next arrows. But if I click on the numbers in between,
    which so far use
    > MM_setTextOfLayer() to swap the image, then the previous
    and next arrows
    > stop working, I don't know why.
    >
    > Beyond this, I have a general question: your script is
    so simple, I don't
    > understand why I would ever use Macromedia's set text of
    layer behavior
    > (or swap image behavior for that matter) which are way
    more complicated.
    > My question is why are these behaviors so complicated
    while your script
    > which just changes the source of an image by its id is
    so incredibly
    > simple. Is there a catch?
    >
    > --
    > seb ( [email protected])
    >
    http://webtrans1.com | high-end web
    design
    > Downloads: Slide Show, Directory Browser, Mailing List

  • Creating a Survey - Novice Javascript Question

    Hello,
    I am extrememely new to Javascript.  I have been doing some research online and copy/pasting code to create the results I need.  I am trying to create an online survey in Dreamweaver in which users select buttons to answer questions and then the total results appear at the bottom of the survey.  So far this is what I have:
    http://sicolaconsulting.com/SurveyTest4.php
    The problem I have with this is that on each line, a user can select more than one box.  I don't want this so I thought radio buttons would be better.  I then came up with this:
    http://sicolaconsulting.com/SurveyTest3.php
    The problem with this is that with the function I am using, I can only get it to display the value of the first line.  I need it to calculate the sum of all the lines.
    Can you help me revise the script I have to get my desired result.
    Here is my code for the first page, followed by the code for the second page.  THANK YOU!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <title>Survey</title>
    <style type="text/css">
    body,td,th {
              font-family: Tahoma, Geneva, sans-serif;
    </style>
    <link href="stylesheets/SCG_Styles.css" rel="stylesheet" type="text/css" />
    <title>Survey</title>
    <script type="text/javascript">
              function TotalPart1A() {
                        document.survey.Total1A.value = '';
                        var sum = 0;
                        for (i=0;i<document.survey.Part1A.length;i++) {
                          if (document.survey.Part1A[i].checked) {
                                    sum = sum + parseInt(document.survey.Part1A[i].value);
                        document.survey.Total1A.value = sum;
    </script>
    <link href="stylesheets/SCG_Styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper"><br />
      <div id="survey-header"><strong>Purpose:</strong><br />
        The Learning Style Survey assesses your general approach to learning. <br />
        It does not predict your behavior, but it is a clear indication of your overall style preferences.<br />
        <br />
        <strong>Instructions:</strong><br />
        For each item circle the response that represents your approach. Complete all items. <br />
        There are eleven major activities representing twelve different aspects of your learning style. <br />
        When you read the statements, try to think about what you generally do when learning. <br />
        <br />
        <strong>Time:</strong><br />
        It takes about 30 minutes to complete the survey. Do not spend too much time on any item. Indicate your immediate response (or feeling) and move on to the next item. <br />
        <br />
        <strong>For each item, enter your immediate response:<br />
          0 = Never  1 = Rarely  2 = Sometimes  3 = Often  4 = Always</strong><br />
      </div>
              <div id="survey">
    <form name="survey">
              <div id="survey-section1">
                    <table class="survey-table" cellspacing="0" width="812">
                      <tr>
                        <td height="24" colspan="2" align="left" bgcolor="#CCCCCC"><strong>Part 1: How I Use My Physical Senses</strong></td>
                        <td height="24" align="center" bgcolor="#CCCCCC"><strong>1</strong></td>
                        <td height="24" align="center" bgcolor="#CCCCCC"><strong>2</strong></td>
                        <td height="24" align="center" bgcolor="#CCCCCC"><strong>3</strong></td>
                        <td height="24" align="center" bgcolor="#CCCCCC"><strong>4</strong></td>
                        </tr>
                      <tr>
                        <td width="31" height="27">1</td>
                        <td width="515" align="left">I remember something better if I write it down.</td>
                        <td width="60"><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td width="60"><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td width="60"><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td width="60"><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td width="31" bgcolor="#EAEAEA">2</td>
                        <td height="27" align="left" bgcolor="#EAEAEA"> I take detailed notes during lectures.</td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td>3</td>
                        <td height="27" align="left">When I listen, I visualize pictures, numbers, or words in my head.</td>
                        <td><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td bgcolor="#EAEAEA">4</td>
                        <td height="27" align="left" bgcolor="#EAEAEA"> I prefer to learn with TV or video rather than other media. </td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td>5</td>
                        <td height="27" align="left"> I use color coding to help me as I learn to work.</td>
                        <td><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td bgcolor="#EAEAEA">6</td>
                        <td height="27" align="left" bgcolor="#EAEAEA"> I need written directions for tasks.</td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td>7</td>
                        <td height="27" align="left"> I have to look at people to understand what they say.</td>
                        <td><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td bgcolor="#EAEAEA">8</td>
                        <td height="27" align="left" bgcolor="#EAEAEA">I understand lecturers better when they write on the board.</td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td>9</td>
                        <td height="27" align="left">Charts, diagrams, and maps help me understand what someone says. </td>
                        <td><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td bgcolor="#EAEAEA">10</td>
                        <td height="27" align="left" bgcolor="#EAEAEA">I remember people’s faces, but not their names. </td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="1" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="2" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="3" onchange="TotalPart1A()"/></td>
                        <td bgcolor="#EAEAEA"><input type="checkbox" name="Part1A" value="4" onchange="TotalPart1A()"/></td>
                        </tr>
                      <tr>
                        <td> </td>
                        <td height="27" align="right">A TOTAL: </td>
                        <td colspan="2"><input type="text" size="10" name="Total1A" value="0"/></td>
                        <td align="right"> </td>
                        <td> </td>
                        </tr>
                      <tr>
                        <td> </td>
                        <td height="27" align="right"> </td>
                        <td> </td>
                        <td> </td>
                        <td align="right"> </td>
                        <td> </td>
                        </tr>
                      </table>
    </form>
                </div>
              </div>
        </body>
        </html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <title>Survey</title>
    <style type="text/css">
    body,td,th {
              font-family: Tahoma, Geneva, sans-serif;
    </style>
    <link href="stylesheets/SCG_Styles.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
              function TotalPart1A() {
                        document.survey.Total1A.value = '';
                        var sum = 0;
                        for (i=0;i<document.survey.radiogroup1A.length;i++) {
                          if (document.survey.radiogroup1A[i].checked) {
                                    sum = sum + parseInt(document.survey.radiogroup1A[i].value);
                        document.survey.Total1A.value = sum;
    </script>
    <link href="stylesheets/SCG_Styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper"><br />
      <div id="survey-header"><strong>Purpose:</strong><br />
        The Learning Style Survey assesses your general approach to learning. <br />
        It does not predict your behavior, but it is a clear indication of your overall style preferences.<br />
        <br />
        <strong>Instructions:</strong><br />
        For each item circle the response that represents your approach. Complete all items. <br />
        There are eleven major activities representing twelve different aspects of your learning style. <br />
        When you read the statements, try to think about what you generally do when learning. <br />
        <br />
        <strong>Time:</strong><br />
        It takes about 30 minutes to complete the survey. Do not spend too much time on any item. Indicate your immediate response (or feeling) and move on to the next item. <br />
        <br />
        <strong>For each item, enter your immediate response:<br />
          0 = Never  1 = Rarely  2 = Sometimes  3 = Often  4 = Always</strong><br />
      </div>
      <div id="survey">
        <form name="survey" id="survey">
          <div id="survey-section1">
          <table class="survey-table" cellspacing="0" width="812">
            <tr>
              <td height="24" colspan="2" align="left" bgcolor="#CCCCCC"><strong>Part 1: How I Use My Physical Senses</strong></td>
              <td height="24" align="center" bgcolor="#CCCCCC"><strong>1</strong></td>
              <td height="24" align="center" bgcolor="#CCCCCC"><strong>2</strong></td>
              <td height="24" align="center" bgcolor="#CCCCCC"><strong>3</strong></td>
              <td height="24" align="center" bgcolor="#CCCCCC"><strong>4</strong></td>
            </tr>
            <tr>
              <td width="31" height="27">1</td>
              <td width="515" align="left">I remember something better if I write it down.</td>
              <td width="60"><input type="radio" name="radiogroup1A" value="1" onchange="TotalPart1A()"/></td>
              <td width="60"><input type="radio" name="radiogroup1A" value="2" onchange="TotalPart1A()"/></td>
              <td width="60"><input type="radio" name="radiogroup1A" value="3" onchange="TotalPart1A()"/></td>
              <td width="60"><input type="radio" name="radiogroup1A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td width="31" bgcolor="#EAEAEA">2</td>
              <td height="27" align="left" bgcolor="#EAEAEA"> I take detailed notes during lectures.</td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup2A" value="1" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup2A" value="2" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup2A" value="3" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup2A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td>3</td>
              <td height="27" align="left">When I listen, I visualize pictures, numbers, or words in my head.</td>
              <td><input type="radio" name="radiogroup3A" value="1" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup3A" value="2" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup3A" value="3" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup3A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td bgcolor="#EAEAEA">4</td>
              <td height="27" align="left" bgcolor="#EAEAEA"> I prefer to learn with TV or video rather than other media. </td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup4A" value="1" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup4A" value="2" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup4A" value="3" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup4A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td>5</td>
              <td height="27" align="left"> I use color coding to help me as I learn to work.</td>
              <td><input type="radio" name="radiogroup5A" value="1" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup5A" value="2" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup5A" value="3" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup5A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td bgcolor="#EAEAEA">6</td>
              <td height="27" align="left" bgcolor="#EAEAEA"> I need written directions for tasks.</td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup6A" value="1" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup6A" value="2" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup6A" value="3" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup6A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td>7</td>
              <td height="27" align="left"> I have to look at people to understand what they say.</td>
              <td><input type="radio" name="radiogroup7A" value="1" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup7A" value="2" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup7A" value="3" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup7A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td bgcolor="#EAEAEA">8</td>
              <td height="27" align="left" bgcolor="#EAEAEA">I understand lecturers better when they write on the board.</td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup8A" value="1" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup8A" value="2" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup8A" value="3" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup8A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td>9</td>
              <td height="27" align="left">Charts, diagrams, and maps help me understand what someone says. </td>
              <td><input type="radio" name="radiogroup9A" value="1" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup9A" value="2" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup9A" value="3" onchange="TotalPart1A()"/></td>
              <td><input type="radio" name="radiogroup9A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td bgcolor="#EAEAEA">10</td>
              <td height="27" align="left" bgcolor="#EAEAEA">I remember people’s faces, but not their names. </td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup10A" value="1" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup10A" value="2" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup10A" value="3" onchange="TotalPart1A()"/></td>
              <td bgcolor="#EAEAEA"><input type="radio" name="radiogroup10A" value="4" onchange="TotalPart1A()"/></td>
            </tr>
            <tr>
              <td> </td>
              <td height="27" align="right">A TOTAL: </td>
              <td colspan="2"><input type="text" size="10" name="Total1A" value="0"/></td>
              <td align="right"> </td>
              <td> </td>
            </tr>
            <tr>
              <td> </td>
              <td height="27" align="right"> </td>
              <td> </td>
              <td> </td>
              <td align="right"> </td>
              <td> </td>
            </tr>
          </table>
        </form>
      </div>
    </div>
    </body>
    </html>

    Hi Nancy,
    I've been away from this for a while and have picked it back up.  I tried your suggested code and I'm having problems getting it to work.  I created a file using the code you supplied for the survey here:
    view-source:http://www.littlechisel.com/clients/GreenSurvey/GreenSurvey.html
    It doesn't work so I know I'm missing something.  If you could advise me on this, it would be great.  Thanks! Here is the code as I have it:
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <script type="text/javascript">
    function calcscore() {
        var score = 0;
        $(".calc:checked").each(function() {
            score += parseInt($(this).val(), 10);
        $("input[name=sum]").val(score)
    $().ready(function() {
        $(".calc").change(function() {
            calcscore()
    </script>
    <link href="stylesheets/Survey.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <h1>jQuery Sum of Radio Fields</h1>
    <form action="">
    <h2>HOW GREEN ARE YOU?</h2>
    <p><strong>I walk/bicycle  to work/school. </strong><br>
    Yes
    <input class="calc" type="radio" name="radio1" value="10">
    No
    <input class="calc" type="radio" name="radio1" value="0">
    Sometimes
    <input class="calc" type="radio" name="radio1" value="5"></p>
    <p><strong>I buy  locally grown food. </strong><br>
    Yes
    <input class="calc" type="radio" name="radio2" value="10">
    No
    <input class="calc" type="radio" name="radio2" value="0">
    Sometimes
    <input class="calc" type="radio" name="radio2" value="5"></p>
    <p><strong>I recycle. </strong><br>
    Yes
    <input class="calc" type="radio" name="radio3" value="10">
    No
    <input class="calc" type="radio" name="radio3" value="0">
    Sometimes
    <input class="calc" type="radio" name="radio3" value="5"></p>
    <p><strong>I compost. </strong><br>
    Yes
    <input class="calc" type="radio" name="radio4" value="10">
    No
    <input class="calc" type="radio" name="radio4" value="0">
    Sometimes
    <input class="calc" type="radio" name="radio4" value="5"></p>
    <p>Total Green Score:
    <input type="text" name="sum">
    </p>
    </form>
    </body>
    </html>

  • Email Template Javascript Error

    For years I have been using BC and I can not believe (embaressingly) that I only just discoved this week that there is a major flaw in the email marketing system, and I have been blindly selling it to my customers unknowingly.
    BC's email campaign process allows you to choose a template from your list of site wide templates to use for your campaign. Of course this is a feature you would want. However Business Catalyst renders a Javascript in the template that gets included in the campaign when it gets sent out.
    What happens is that the text 'var slang={module_urlculture}' appears just above the newsletter content in the customers inbox. Only if it is lucky enough to get past spam filters.
    This is a major flaw with the BC's email marketing system, and if I had known about it years ago when it was first discovered i would have fought tooth and nail to have it fixed.
    What bewilders me more is that this bug has been know to BC and is in fact listed on BC's buglist for years!
    God only knows how many readers have not recieved, unsubscribed, not read, deleted, blacklisted newsletters delivered out of BC's newsletter system.
    I can live with limited functionality with the email marketing suite, but BC you better damn well make sure when you have a specific feature to choose a sitewide template for a campaign, that it DOES NOT render javascript in the newsletter!!!
    below is what renders in BC newsletter source code just prior to the body:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <!-- BC_OBNW -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>May Newsletter</title>
    <link href="/StyleSheets/ModuleStyleSheets.css" type="text/css" rel="StyleSheet" />
    <script type="text/javascript">var jslang='{module_urlculture}';</script>
    <meta name="robots" value="noindex, nofollow" />
    </head>
    It would appear to me that BC does not distinguish that a template is being used for a campaign.
    This needs to be rectified straight away. We have clients that send campaigns to education and government bodies and its tough enough to get through their sensitive filters with out having javascript render in the newsletters.
    Billy Bowyer.

    Hi Liam,
    Thanks for all the details and clear response.
    I understand what you are saying about just using the HTML content area to build newsletters. In an ideal world your comments are spot on.
    however we have a range of clients who use the email marketing side BC for a range of things, and in some cases it makes good sense to use the Sitewide templates. for example we have a client who has a loyalty campaign with about 25 newsletters, all fairly simple text based messages with their company header and footer. We created a neat little template with the header and footer (all clean HTML and inline csss), so all the client needs to do is type in their personal meassge in the campaign content area...its simple, effective and what they need.
    Now I've found out that all 25 campaigns have been sending with full header code, and in some cases with var jslang={module_urlculture} at the top of the message.
    You see Liam I have been building email newsletters for years and know full well that they need to built using basic HTML and inline CSS, that floats don't work plus a range of other CSS styles and HTML tags.
    As you said its 101 stuff, I am sure the dev team at BC know this stuff too. So why is it that when building a campaign or managing system emails (basically every area in BC where you can manage out bound emails) there is an option to choose a site wide template? Beacause it's expected that we would build a (clean) newsletter template and store it in the sitewide templates to be called on. So Liam, you see, BC has been built with the expectation that designers would build clean friendly newsletter templates and store them in the sitewide templates area.
    What I didn't know was that BC would take my purpose built newsletter template and inject it with:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <!-- BC_OBNW -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>May Newsletter</title>
    <link href="/StyleSheets/ModuleStyleSheets.css" type="text/css" rel="StyleSheet" />
    <script type="text/javascript">var jslang='{module_urlculture}';</script>
    <meta name="robots" value="noindex, nofollow" />
    </head>
    "Yep as an improvement only showing newsletter templates in the dropdown would be handy but you would need to have something in the template that BC knows to define email only and only show up there." Considering there is an ability to select a print version template and also the ability to edit a Desktop /tablet /Smart phone version of a template I would say BC have the technology to make a 'Campaign Only' selection in the templates.
    Even if it is only 1 template, it could be used across 100 campaigns, being sent to 100,000 contacts - and this makes it important.
    regardless - the dropdown menu access to the sitewide templates in campaigns has been purpose built in to BC and as has been for as long as I can remember (at least 5 years), and as such it should work properly to ensure the most effective deliverability, readability and coversion rates.
    So right now BC has 2 options (in my opinion):
    1: Stop all the head code rendering in campaigns (either automated or define an 'email only' option with in sitewide templates)
    2: Remove the 'choose a template' option from all system emails and campaigns (if it doesn't work properly it shouldn't be there).
    Lastly to answer you querie, I spoke with a highly credible member of the BC team who said the 'head code rendering in newsletters' was added to BC's internal bug list over 2 years ago. So it is disappointing that it still exists and that my clients have been sending out campaigns with this going on, if only I knew...
    Thanks - Billy Bowyer

  • Dreamweaver Template & Javascript

    I have a Dreamweaver template with this script:
    <SCRIPT type="text/javascript">
    <!--
    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new
    Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
    i<a.length; i++)
    if (a
    .indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr;
    for(i=0;a&&i<a.length&&(x=a
    )&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document;
    if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for
    (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers
    .document);
    if(!x && d.getElementById) x=d.getElementById(n);
    return x;
    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new
    Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x;
    if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    // Comma separated list of images to rotate
    var imgs = new
    Array('images/northcampus/IMG_0587.JPG','images/northcampus/IMG_0593.JPG','images/northca mpus/IMG_0596.JPG','images/northcampus/IMG_0620.JPG','images/northcampus/IMG_0625.JPG');
    // delay in milliseconds between image swaps 1000 = 1 second
    var delay = 5000;
    var counter = 0;
    function preloadImgs(){
    for(var i=0;i<imgs.length;i++){
    MM_preloadImages(imgs
    function randomImages(){
    if(counter == (imgs.length)){
    counter = 0;
    MM_swapImage('rotator', '', imgs[counter++]);
    setTimeout('randomImages()', delay);
    //-->
    </SCRIPT>
    When I create a new htmlpage & attach the template, the
    new page has extra code in my script! The last function turns out
    like this:
    function randomImages(){
    if(counter == (imgs.length)){
    counter = 0;
    MM_swapImage('rotator', '', imgs[counter++]imgs);
    function randomImages(){
    if(counter == (imgs.length)){
    counter = 0;
    MM_swapImage('rotator', '', imgs[counter++]);
    setTimeout('randomImages()', delay);
    How can I stop this from happening? It breaks my new page
    every time!
    Thanks for any ideas,
    nicki

    Upload the template file and post a link to it, please.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "akmagnolia" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have a Dreamweaver template with this script:
    >
    >
    > -----------------------
    > <SCRIPT type="text/javascript">
    > <!--
    > function MM_preloadImages() { //v3.0
    > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new
    Array();
    > var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
    for(i=0;
    > i<a.length;
    > i++)
    > if (a
    .indexOf("#")!=0){ d.MM_p[j]=new Image;
    > d.MM_p[j++].src=a;}}
    > }
    >
    > function MM_swapImgRestore() { //v3.0
    > var i,x,a=document.MM_sr;
    for(i=0;a&&i<a.length&&(x=a
    )&&x.oSrc;i++)
    > x.src=x.oSrc;
    > }
    >
    > function MM_findObj(n, d) { //v4.01
    > var p,i,x; if(!d) d=document;
    >
    if((p=n.indexOf("?"))>0&&parent.frames.length) {
    > d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);}
    > if(!(x=d[n])&&d.all) x=d.all[n]; for
    (i=0;!x&&i<d.forms.length;i++)
    > x=d.forms[n];
    >
    for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    > x=MM_findObj(n,d.layers
    .document);
    > if(!x && d.getElementById)
    x=d.getElementById(n); return x;
    > }
    >
    > function MM_swapImage() { //v3.0
    > var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new
    Array;
    > for(i=0;i<(a.length-2);i+=3)
    > if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x;
    if(!x.oSrc)
    > x.oSrc=x.src; x.src=a[i+2];}
    > }
    >
    > // Comma separated list of images to rotate
    > var imgs = new
    >
    Array('images/northcampus/IMG_0587.JPG','images/northcampus/IMG_0593.JPG','image
    >
    s/northcampus/IMG_0596.JPG','images/northcampus/IMG_0620.JPG','images/northcampu
    > s/IMG_0625.JPG');
    > // delay in milliseconds between image swaps 1000 = 1
    second
    > var delay = 5000;
    > var counter = 0;
    >
    > function preloadImgs(){
    > for(var i=0;i<imgs.length;i++){
    > MM_preloadImages(imgs
    > }
    > }
    >
    > function randomImages(){
    > if(counter == (imgs.length)){
    > counter = 0;
    > }
    > MM_swapImage('rotator', '', imgs[counter++]);
    > setTimeout('randomImages()', delay);
    > }
    > //-->
    > </SCRIPT>
    >
    >
    > ----------------------------------
    >
    > When I create a new htmlpage & attach the template,
    the new page has extra
    > code in my script! The last function turns out like
    this:
    >
    >
    > -------------------------------
    > function randomImages(){
    > if(counter == (imgs.length)){
    > counter = 0;
    > }
    > MM_swapImage('rotator', '', imgs[counter++]imgs);
    > }
    > }
    >
    > function randomImages(){
    > if(counter == (imgs.length)){
    > counter = 0;
    > }
    > MM_swapImage('rotator', '', imgs[counter++]);
    > setTimeout('randomImages()', delay);
    > }
    >
    >
    > --------------------------
    >
    > How can I stop this from happening? It breaks my new
    page every time!
    > Thanks for any ideas,
    > nicki
    >
    >

  • Multi-templates - some questions

    Hi...
    Setting up a site and need multiple templates for the
    following reason:
    They may require / ask for colour coding in the main
    navigation and masthead
    areas and subsequent pages.
    What i want to do is use SSIs to simplify later modifications
    of the
    navigation. Main navigation will be common across the site.
    Using PMM for
    the menu (horizontal).
    What i propose is this:
    Master file uses SSI for Navigation menu and footer. Use a
    copy / paste of
    the master to create sub templates for the various, proposed
    sections.
    Set up variations of the PMM css. Eg. PMMblue.css,
    PMMgreen.css, etc. (Only
    colours are changing here.) In each of the sub templates link
    to that
    particular PMM css. Set the editable regions in the sub
    templates - will
    actually be identical across the board.
    Common navigation SSI for updating links - which will be
    identical. Common
    footer will be identical.
    Anyone see any problems?
    Grateful for feedback...
    Thanks and Cheers,
    JJ

    > If i have one master template for all pages, effecting
    these kinds of
    > changes will be more of a hassle no?
    No. It would be pretty simple, and the method would depend on
    your skill
    and ability with things like javascript or server-side
    scripting. Here are
    several methods you could consider (all shown with XHTML tag
    syntax) -
    1. The simplest would be to make the link to your *base*
    stylesheet
    (containing color scheme #1) link
    <link href="base.css" rel="stylesheet" type="text/css"
    />
    ABOVE the editable region called "head" in the head of the
    template. This
    would let you add a 'modifier' stylesheet link within that
    editable region
    that would change the color scheme as needed. Since this
    modifier link is
    BELOW the base link, conflicting rules will fall with the
    modifier rather
    than the base.
    2. A more complex method would be to have dynamically written
    stylesheet
    links below the base link (both of which are BELOW the
    editable region in
    the head region called "head" -
    <script type="text/javascript">if (styles == 2) {
    document.write('<link
    href="scheme2.css" rel="stylesheet" type="text/css" /' +
    '>') }</script>
    <script type="text/javascript">if (styles == 3) {
    document.write('<link
    href="scheme3.css" rel="stylesheet" type="text/css" /' +
    '>') }</script>
    and then in the editable region called "head" which is ABOVE
    this scripting,
    put this (on each child page - adjust the value of 'styles'
    as needed) -
    <script type="text/javascript">var styles =
    2;</script>
    3. Use a Template Conditional expression to determine which
    stylesheet to
    link based on the value of a Template parameter (use DW's F1
    Help to work
    through this).
    4. Use server scripting to dynamically write the appropriate
    stylesheet
    link based on a lookup, or some other conditional logic.
    Take your pick.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Jay Jhabrix" <[email protected]> wrote in message
    news:[email protected]...
    >
    > "Murray *ACE*" wrote:
    >
    >> DO NOT USE "sub templates". They'll drive you nuts.
    I don't see any
    >> need for them in the scheme that you have presented.
    >
    > Murray,
    >
    > Sorry, again, lack of lucidity in my description. Let's
    drop the 'sub' for
    > the templates.
    >
    > What i meant was, i have the master layout file (not a
    template, just the
    > design master) from which i create individual templates
    for each section
    > and its child pages.
    >
    > The way i figure it is:
    >
    > They may want colour coding according to section. So,
    certain elements -
    > say menu bar, item in header, may need to change at a
    later date according
    > to section. Therefore, creating the sectional pages
    would be easier with
    > individual section templates as a change here would
    apply to all child
    > pages in the section. Also, maintaining the SSIs would
    be easier and could
    > be locked in the non-editable region:
    >
    > Section 1 template:
    > <!--#include file="fooblue.ssi" -->
    >
    > Section 2 template:
    > <!--#include file="fooblack.ssi" -->
    >
    > If i have one master template for all pages, effecting
    these kinds of
    > changes will be more of a hassle no?
    >
    > Cheers,
    >
    > JJ
    >
    >
    >> --
    >> Murray --- ICQ 71997575
    >> Adobe Community Expert
    >> (If you *MUST* email me, don't LAUGH when you do
    so!)
    >> ==================
    >>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >> ==================
    >>
    >>
    >> "Jay Jhabrix" <[email protected]> wrote in
    message
    >> news:[email protected]...
    >>> Hi...
    >>>
    >>> Setting up a site and need multiple templates
    for the following reason:
    >>>
    >>> They may require / ask for colour coding in the
    main navigation and
    >>> masthead areas and subsequent pages.
    >>>
    >>> What i want to do is use SSIs to simplify later
    modifications of the
    >>> navigation. Main navigation will be common
    across the site. Using PMM
    >>> for the menu (horizontal).
    >>>
    >>> What i propose is this:
    >>>
    >>> Master file uses SSI for Navigation menu and
    footer. Use a copy / paste
    >>> of the master to create sub templates for the
    various, proposed
    >>> sections.
    >>>
    >>> Set up variations of the PMM css. Eg.
    PMMblue.css, PMMgreen.css, etc.
    >>> (Only colours are changing here.) In each of the
    sub templates link to
    >>> that particular PMM css. Set the editable
    regions in the sub templates -
    >>> will actually be identical across the board.
    >>>
    >>> Common navigation SSI for updating links - which
    will be identical.
    >>> Common footer will be identical.
    >>>
    >>> Anyone see any problems?
    >>>
    >>> Grateful for feedback...
    >>>
    >>> Thanks and Cheers,
    >>>
    >>> JJ
    >>>
    >>>
    >>>
    >>
    >
    >

  • Presentation Template javascript w/ adaptive tags, how to tweak this code?

    I have a snippet of code in one of my presentation templates, that I need to make a minor change to it, as the document.write javascript code causes my link to be explicitly coded into the page output. I found that on another template where I don't need to use javascript, the link is parsed by the portal, which causes the link to be created using gatewaying. I actually need the portal to create this link using gatewaying, as it won't work otherwise (the image won't display unless the gateway URL is produced). Here's the snippet of code I'm looking at:
    <pcs:if expr="ShowPrintButton">
         <script language=JavaScript>
         if (displaybuttons == true)
              document.write("<a href='JavaScript:window.print();' alt='Print Article' title='Print Article'><img src='http://pubcontent.state.pa.us/publishedcontent/preview/general_ops/sers/images/public/action_print.gif' align='absmiddle' border='0' alt='Print Article' title='Print Article' /></a>");
         </script>
    </pcs:if>
    In my other presentation template, I don't need to check for a condition as I do in the case above, so no javascript is needed. So in that case I just put the image tag in the PT code on its own, with no javascript tags around it. In that case, the URL of the image output by that code is:
    http://www.portal.state.pa.us/portal/server.pt/gateway/PTARGS_0_127743_785_14364_0_43/http%3B/pubcontent.state.pa.us/publishedcontent/preview/general_ops/sers/images/public/action_print.gif
    This image link above works, and the image displays as desired. However, the explicit link without gatewaying, as in the javascript above, it will output the URL as:
    http://pubcontent.state.pa.us/publishedcontent/preview/general_ops/sers/images/public/action_print.gif
    which does not work since it didn't gateway the link. Is there a way I can tweak the javascript above to still be checking the condition and yet have the URL be gatewayed?
    Thanks!

    Got it working, although there is still some issue with the edocs not being up to date. Issue was a cross between some security settings and cache.
    <!-- Links to my communities are stored in commenu -->
    <pt:ptdata.communityactionsdata     pt:id="commmenu" />
    <pt:ptdata.mycommunitiesdata        pt:id="commmenu" />
    <!-- Links to mandatory communites are stored in menutabs -->
    <pt:ptdata.mandtabcommsdata         pt:id="mandmenu2" /> <!-- this display the mandatory tabbed communities -->
    <!-- Links to my pages are stored in mypagemenu -->
    <pt:ptdata.mypageactionsdata        pt:id="mypagemenu" />
    <pt:ptdata.mypagesdata              pt:id="mypagemenu" />
    <pt:plugnav.ddmenurowcontainer pt:menuvar="midrowmenu" pt:hideemptymenus="true" >
    <pt:plugnav.ddmenutab pt:containervar="midrowmenu" pt:datavar="mypagemenu" pt:text="$#1840.ptmsgs_portalbrowsingmsgs" />
    <pt:plugnav.ddmenutab pt:containervar="midrowmenu" pt:datavar="commmenu" pt:text="$#1841.ptmsgs_portalbrowsingmsgs" />
    <pt:plugnav.ddmenutab pt:containervar="midrowmenu" pt:datavar="directorymenu" pt:text="$#1842.ptmsgs_portalbrowsingmsgs" />
    <pt:plugnav.ddmenusimpletabs pt:containervar="midrowmenu" pt:datavar="mandmenu2" />
    </pt:plugnav.ddmenurowcontainer>

  • Data Template construction AND data template validation questions:

    Hello World.
    I am new to Oracle BI and I have sucessfully used the BI Java APIs to create from start to finish a pdf report process. I use the DataProcessor, RTFProcessor, and FOProcessor classes to do this. My question is other than the most simple of Data Templates being used, how is everyone building their data templates? And I would also like to know how are developers validating the actual data template file? I have submitted a request through my MetaLink account for obtaining either a "dtd" or "xsd" file that could be used to validate a constructed data template. I have not received any real answers. I plan on using either XMLSpy or MyEclispse 6 to create my data templates, but I need a "rule book" dtd or xsd file in order to use the auto prompting feature. Making a data template "in the dark" cannot be the method of choice for all of the developers that visit this forum. I see some really fancy/detailed reports and I would like to see how people are building there data templates. Building the data template is at least half the battle when constructing a BI report.
    Thanks for your time.

    Notepad is the developer's choice for data definitions, seriously.
    I have seen and used XMLSpy and have Stylus Studio but they are really a bit of overkill for the data templates. I use Stylus Studio for some of our XML-FO format templates, but that is another story.
    Scott
    Edited by: ScottC on Oct 22, 2008 3:00 PM

  • Ionic Side Menu Template - Javascript JavaScript runtime error: [$injector:nomod] Module 'ngLocale' is not available!

    I am using VS 2013 ,CTP 3.1
    When I tried to run the Ionic side menu template on Emulator 8.1, the javascript console shows below exception  -
    Exception was thrown at line 9576, column 11 in ms-appx://io.cordova.myapp8724a31325644ec29a8d2d88682b7987/www/lib/ionic/js/ionic.bundle.js
    0x800a139e - JavaScript runtime error: [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
    http://errors.angularjs.org/1.3.6/$injector/nomod?p0=ngLocale
    There was no code changes to any of the files.
    Please advise.

    Yes. I am using the same template.
    I am not able to attach the screenshot here.
    This is the error -
    'WWAHOST.EXE' (Script): Loaded 'Script Code (MSAppHost/2.0)'. 
    Exception was thrown at line 9576, column 11 in ms-appx://io.cordova.myapp8724a31325644ec29a8d2d88682b7987/www/lib/ionic/js/ionic.bundle.js
    0x800a139e - JavaScript runtime error: [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot
    to load it. If registering a module ensure that you specify the dependencies as the second argument.
    http://errors.angularjs.org/1.3.6/$injector/nomod?p0=ngLocale

  • GoLive Javascript question

    I have some existing code from their previous web coder and wondered on the code below, how can i make some of these links open in a new window?
    Is this Javascript used specifically from GoLive?
    thakns for any help! 
    <script type="text/javascript">
    <!--
    CSAct[/*CMP*/ 'C2B3FE26189'] = new Array(CSGotoLink,/*URL*/ 'main.html','');
    CSAct[/*CMP*/ 'C2B3FE26190'] = new Array(CSGotoLink,/*URL*/ tour/Tour.html','');
    CSAct[/*CMP*/ 'C2B3FE26191'] = new Array(CSGotoLink,/*URL*/ 'members/index.html','');
    CSAct[/*CMP*/ 'C2B3FE26195'] = new Array(CSGotoLink,/*URL*/ 'Join.html','');
    CSAct[/*CMP*/ 'C2B3FE26196'] = new Array(CSGotoLink,/*URL*/ 'FAQs.html','');
    CSAct[/*CMP*/ 'C2B3FE26197'] = new Array(CSGotoLink,/*URL*/ 'links.html','');
    CSAct[/*CMP*/ 'C2B3FE26198'] = new Array(CSGotoLink,/*URL*/ 'Contact.html','');
    CSAct[/*CMP*/ 'C2B3FE26199'] = new Array(CSGotoLink,/*URL*/ 'webmasters.html','');

    selecting the link in layout view takes me to this-
    <a title="free  tour" onclick="CSAction(new Array(/*CMP*/'C2B3FE0E190'));return CSClickReturn()" onmouseover="changeImages('tour','navigation/tour-over.gif');return true" onmouseout="changeImages('tour','navigation/tour.gif');return true" href="#"><img id="tour" src="navigation/tour.gif" alt="tour button" name="tour" width="55" height="45" border="0"></a>
    which seems to call the javascript code i pasted earlier, hence the question.

  • LWAP Template Scheduler Question

    Hello,
    I have two questions about LWAP templates and creating a schedule to 'audit' their settings.
    First, when you create a scheduled task to run, and you add APs, will it run the 'Select APs' portion of the task each time? Or, does the list of APs have to stay static?
    Second, if it runs the query each time for the selected APs to apply the template to; can you create a search with a wildcard?
    Here is what I am trying to accomplish:
    HA Template WLC1>2
    HA Template WLC2>1
    APs with name MMM-FFF-* get template WLC1>2
    APs with name NNN-GGG-* get template WLC2>1
    *=wildcard
    To dive further I would also like to have a seperate template for APs named: NNN-GGG-*-OAP-* (this would be template WLC3>4)
    I hope this makes sense.....

    Hi Todd
    We have no way of knowing that there is no data until we run the report. I can not currently think of a way we could possibly do this w/o executing the extract?
    We have report sets coming in a later release where you could chain two reports together - if there is no data found in the first then the second could be stopped but thats a little ways out yet.
    Regards
    Tim
    http://blogs.oracle.com/xmlpublisher

  • Xcode template comment Question

    Hi,
    I've made a few template wich import the framework I currently use and place them into Xcode.
    When I create a new project I can see them where I want them (that's cool).
    The only thing I miss is when I click on one of my template there is no info for them.
    Where can I add this info?
    So I can write a note to myself of what exactly is in that template.
    For now I use abreviation into the name but that technique as it's limite.
    Thanks

    I'm a little confused by the phrasing of your question. You have created an Xcode project template. When you create a new project in Xcode and select your template from the list of project templates, you want a description of your template to appear in the text field under the list of project templates. Am I correct in figuring out what you want?
    If I am correct, you need to modify the TemplateInfo.plist file that resides inside the Xcode project file's bundle. Change the Description field to what you want to see when you select the project from the list of project templates. For more detailed information, go to the following URL and read the tip Adding Descriptions to Your Project Templates:
    http://www.meandmark.com/xcodetips.html
    Message was edited by: Mark Szymczyk
    Message was edited by: Mark Szymczyk

Maybe you are looking for