Javascript within FP2003 doesn't work when posted to web

O

OSL

I've used a javascript to create a short questionnaire where visitors choose
a number from a dropdown box and it is used in a calcuation. The script
works fine in preview until I post it to the website using Frontpage
publisher. Then it seems to break.

Am I doing something wrong? there is no change at all in the code.

Thanks
 
S

Stefan B Rusynko

Post a URL




| I've used a javascript to create a short questionnaire where visitors choose
| a number from a dropdown box and it is used in a calcuation. The script
| works fine in preview until I post it to the website using Frontpage
| publisher. Then it seems to break.
|
| Am I doing something wrong? there is no change at all in the code.
|
| Thanks
 
S

Steve Easton

I get an error: document.form.sum is null or not an object.
Try making sum, sum1, sum2 etc global variables just before: function updatesum()
like this:

<script type="text/javascript"><!--
var sum
var sum1
var sum2
var sum3
var sum4
function updatesum() {

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
O

OSL

Steve,

tried it but get the same message. However, I'll retype the code in a new
page and see what happens. It may be that something has crept into the code
through the Frontpage editor that is causing this to be inoperable.

Back soon with the results.

Len
 
S

Stefan B Rusynko

You have 3 forms on the page,
the 1st one (your calculator) does not have a closing </form> tag
Plus a broken script tag at the end of the page
-->
SCRIPT
</body>
should be
-->
</SCRIPT>
</body>

PS
FP 2003 does not write <option> tags w/o closing </option> tags by default (unless you have changed the defaults), so you have been
hand coding and creating code errors breaking your page



| Steve,
|
| tried it but get the same message. However, I'll retype the code in a new
| page and see what happens. It may be that something has crept into the code
| through the Frontpage editor that is causing this to be inoperable.
|
| Back soon with the results.
|
| Len
|
| "Steve Easton" wrote:
|
| > I get an error: document.form.sum is null or not an object.
| > Try making sum, sum1, sum2 etc global variables just before: function updatesum()
| > like this:
| >
| > <script type="text/javascript"><!--
| > var sum
| > var sum1
| > var sum2
| > var sum3
| > var sum4
| > function updatesum() {
| >
| > --
| > Steve Easton
| > Microsoft MVP FrontPage
| > 95isalive
| > This site is best viewed............
| > ........................with a computer
| >
| > | > > The url is http://www.outsourcesales.com/AcidTest_ROI.htm
| > >
| > > Thanks for your help.
| > >
| > > PS: you'll notice that the form takes the input from the top 4 drop down
| > > boxes but the calculated values at the bottom no longer works...but did when
| > > I did a preview prior to publishing using Frontpage.
| > >
| > > "Stefan B Rusynko" wrote:
| > >
| > > > Post a URL
| > > >
| > > > --
| > > >
| > > > _____________________________________________
| > > > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > > > "Warning - Using the F1 Key will not break anything!" (-;
| > > > To find the best Newsgroup for FrontPage support see:
| > > > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > > > _____________________________________________
| > > >
| > > >
| > | > > > | I've used a javascript to create a short questionnaire where visitors choose
| > > > | a number from a dropdown box and it is used in a calcuation. The script
| > > > | works fine in preview until I post it to the website using Frontpage
| > > > | publisher. Then it seems to break.
| > > > |
| > > > | Am I doing something wrong? there is no change at all in the code.
| > > > |
| > > > | Thanks
| > > >
| > > >
| > > >
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top