Hello potential helpers…
I’m trying to add a second, separate search form in the sidebar (manually, no widgets). I coded it in a separate .php file, where it works perfectly. Yet when trying to load it in the sidebar via the
<?php includefunction, one certain Java function that I implemented in the search form php file doesn’t seem to work correctly, making the form displaying wrong.
For the search form, which is radio button based, I use three different scripts:
1) the script to make the form behave like a search form:
2) The script to get the radio buttons marked when the label is clicked:
and 3) (a.k.a. the culprit): the script to have the labels colored, depending on whether the corresponding radio button is checked or not:
I’m fairly certain it’s the third script that doesn’t work well in the sidebar. I got it from here (third post), and as you can see in the search form php-file, it works perfectly by itself, in a single php file (that’s why I made the radio buttons
display:none, so don’t wonder why they’re not shown). The script works by changing the label class from “off” to “on” when the radio button is checked, and back to “off” when another one is checked. But when implemented in the sidebar, it seems the label classes are not changed upon clicking, so my conclusion would be the problem is the third script.
The CSS looks like this: http://pastebin.com/f39b6fb07
The actual form looks like this: http://pastebin.com/f4ed92849
The form implemented in the sidebar (i.e. not displaying properly): http://the-fruit-stand.bplaced.net/tfs/ (“repaints search” section)
Any idea what might be wrong? I already concluded it’s not a CSS hierarchy problem (turned of the theme’s style.css, to no avail).
Many thanks in advance.
Edit: WP version is 2.8.6, not 2.8.5 – I must have misclicked.
Of course, after writing all that down, I found a somewhat cheaty solution: instead of using
<?php includeI now use the
<object>tag, and low and behold, it works just like it should. The only thing I need to figure out is the
targettag, how to get the search results out of the
<object>and back into the main window.
Still, it would be interesting to learn why it wouldn’t work via
- The topic ‘Java function in sidebar’ is closed to new replies.