faq problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Sir Helpsalot
    Private First Class

    • Jan 2010
    • 9

    faq problems

    Hi all, - http://www.projectcreategame.co.uk/faq

    I need some help with an faq I have added to my website. I have got it up and running but when I click on the questions it will only open the top question. If i try to open a another question below and I already have the top question expanded, it closes the top question and that's it, nothing else happens. The only way I have found to read all questions and answers, is if you go to print all FAQ's and then they all expand.

    I don't have much knowledge of script or HTML and therefore am very dubious about going into the php files in the Cpanel and playing about with them, without knowing really what i'm doing.

    I'm not sure what to do, I can't find anything about this on the forums or in the videos. Please help.
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: faq problems

    I believe that there is something wrong in your Javascript function definition as it is independent from the question one clicks on. Under this point of view it is normal that it will always and only open the first answer and not the others. Check your Javascript and links.


    Actually it seems that your script is using hidden forms, with hidden fields, and the question text link is the "submit" text of each form. BUT, it is outside the form boundaries.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • Sir Helpsalot
      Private First Class

      • Jan 2010
      • 9

      #3
      Re: faq problems

      Yeah I had a look at the script and where it reads the "submit" text, it doesn't look finished or in the right place for that matter. Bearing in mind i don't really know what i'm talking about I have saved the document and will have a fiddle and hopefully strike lucky.

      Thanks for your help

      Comment

      • Sir Helpsalot
        Private First Class

        • Jan 2010
        • 9

        #4
        Re: faq problems

        Ok I have been trying nearly all day to figure this out.
        I have been rearranging, rewriting and looking all over the web to try and find out how this text should read. The Code;

        print "<tr>
        <td class=\"QA\" valign=\"top\">Q </td>";

        print "<form name=\"quest\" id=\"quest\" action=\"$PHP_SELF\" method=\"post\">\n";
        print "<input type=\"hidden\" name=\"category_id\" value=\"$category_id\"></p>\n";
        print "<input type=\"hidden\" name=\"cat_name\" value=\"$cat_name\">\n";
        print "<input type=\"hidden\" name=\"answer\" value=\"0\">\n";
        print "</form>\n<td><pre class=\"question\"><a href=\"javascript:submit_faq();\">$row[question]</a></pre>";
        print "</td></tr>\n";

        print "<tr>
        <td class=\"QA\" valign=\"top\">A</td>
        <td><pre class=\"answer\">$row[answer]</pre>
        <br>
        <a href=\"$PHP_SELF?answer=0&cat_name=$cat_name&categ ory_id=$category_id#$answer\">" . $s_close . "</a><br></td>
        </tr>\n";
        }


        else {

        print "<tr>
        <td class=\"QA\" valign=\"top\">Q <a name=\"$row[id]\"></td>
        </td>";
        print "<form name=\"quest\" id=\"quest\" action=\"$PHP_SELF\" method=\"post\">\n";
        print "<input type=\"hidden\" name=\"category_id\" value=\"$category_id#$row[id]\"></p>\n";
        print "<input type=\"hidden\" name=\"cat_name\" value=\"$cat_name\">\n";
        print "<input type=\"hidden\" name=\"answer\" value=\"$row[id]\">\n";
        print "<pre class=\"question\"><a href=\"javascript:submit_faq();\">$row[question]</a></pre>";
        </tr>\n";
        }

        As shown is not correct in some manner of speaking, its for an FAQ and at the moment when you click on the question only the top question will open and close the others don't do anything.
        The only thing I can see in this text that might show this to be the case is the fact that this ' "QA\" valign=\"top\">Q <a ' is repeated on each line and therefore I'm thinking that only the top Q/A will open as a result. The problem I have is I have no idea if that is correct and if it is I don't know what to put in it's place if it does need changing.

        I completely stumped here I would really appreciate some help.

        Comment

        Working...
        X