Solved

Modifying Template so that body (onload) function can be changed as required

Posted on 2006-07-05
3
252 Views
Last Modified: 2010-04-25
Hi all,
I have child pages where many of them require a different body onload tag (i.e. <body onLoad="document.theformonthepage.submit();"> ). I want to make this region editable on the child pages so I can alter this as required. When I try to select the text in the code and click add editable region it doesn't work. I've also tried going to Template > Modify > Make Attribute Editable but it goes I can't seem to edit it correctly on the child page. It gives me this on the child page:
<!-- InstanceParam name="onload" type="text" value="start()" -->
</head>

I think the above is concerned with the <head> as its enclosed in the tag and when I change the onload to the document.theformonthepage.submit();" it doesn't work. e.g (<!-- InstanceParam name="onload" type="text" value="document.form1.submit();" -->)
Anyone have any ideas?
Thanks,
D
0
Comment
Question by:dereksheahan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:dereksheahan
ID: 17041235
I've also tried creating a second template with the body onload tag included but run into the same problem as I can't edit the name of the form in it (i.e. onLoad="document.theformonthepage.submit();"> )
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 450 total points
ID: 17044653
Hi Derek,

1. Open the template.  In code view, change the body tag so it looks like this:  <body onload="">

2. In design view, click the body tag from the tag selector at the bottom of the screen

3. From the menu, select Modify | Template | Make Attribute Editable

4. In the dialog, the attribute ONLOAD should show up in the box automatically.  Click the "Make attribute editable" checkbox

5. For the rest of the options:

Label = this is what DW will display to you so you know what you are editing.  I'm leaving it as onload for demo
Type = leave as text
Default = you can leave this blank or put your most common JS statement (i.e. document.theformonthepage.submit(); )

Click ok to set it.  In code view of the template, you should see something like this:

<!-- TemplateParam name="onload" type="text" value="document.theformonthepage.submit();" -->

And the body tag will look like this:

<body onLoad="@@(onload)@@">.

Now, apply the template to a new blank page.  After application,  go to Modify | Template Properties and you will see a dialog with "onload" in it.  Select onload and enter whatever you need.
0
 

Author Comment

by:dereksheahan
ID: 17053478
Great Jason, that fixed it alright!
Thanks,
D
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question