Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-05 23:04:38

sosborne
New Member
Registered: 2006-07-05
Posts: 3

Inserting javascript in a form or a page

Hello: I am trying to insert a simple javascript vertical scroller. The installation says merely to insert the script into the html where you want the scroller to appear. I would like to put the scroller into a form but it does not execute when I try it.

Is there a trick to inserting scripts into forms?

thankyou

—Stephen o

Offline

#2 2006-07-05 23:35:26

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Inserting javascript in a form or a page

No trick. Is this live anywhere we can see?

Offline

#3 2006-07-06 00:58:07

sosborne
New Member
Registered: 2006-07-05
Posts: 3

Re: Inserting javascript in a form or a page

The script I’m trying to install is right here:
http://www.javascriptkit.com/script/script2/verticalscroller.shtml

(it looks simple enough!)

any advice much appreciated.
—s

Offline

#4 2006-07-06 01:27:58

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Inserting javascript in a form or a page

Sorry, I should have been more clear: I mean the site you’re trying to put it on, so we can see how far you’ve gotten. :)

Offline

#5 2006-07-06 01:39:16

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Inserting javascript in a form or a page

I tried it in a form and it didn’t work for me either.

Offline

#6 2006-07-06 01:40:44

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Inserting javascript in a form or a page

Do you get any warnings or error messages, or does it just not appear?

Offline

#7 2006-07-06 01:43:49

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Inserting javascript in a form or a page

No warnings, the only thing that showed was the bottom paragraph that links back to the site.

The Javascript didn’t run even though it was all in view source.

Offline

#8 2006-07-06 01:44:55

sosborne
New Member
Registered: 2006-07-05
Posts: 3

Re: Inserting javascript in a form or a page

I’m working on a txp site that isn’t public yet: I don’t know how to show it to you. Here are the 2 code snippets if that might help:

Here is the relevant page code for the header:
<!— page header—>

<!—GEIST logo—> <div id=“header2”> <txp:output_form form=“site_header_SO” /> </div>

and here is the form that I use to put the logo on the left and (if poss) the javascript on the right (the logo image id46 displays as it should):

form: site_header_SO:

<txp:link_to_home>
<txp:image id=“46” class=“headlines_left” border=“0” />
</txp:link_to_home>

<div class=“headlines_right”>

>>>>> here is where i tried putting the javascript straight up between <script> tags<<<<<

</div>

—so

Offline

#9 2006-07-06 02:16:32

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Inserting javascript in a form or a page

I just checked, and it’s because of the XHTML doctype. Once you take that out, it works.

So, there’s something conflicting about the script itself. I’d suggest putting it into an external file, and including a call to that from your form.

Offline

#10 2006-07-07 01:17:54

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Inserting javascript in a form or a page

Try this one from stilleye

Offline

Board footer

Powered by FluxBB