Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2014
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Need help getting a hyperlink to work in xml document

    Hello,

    I bought a quiz script that I have customized for a client. The quiz is controlled by a .js file which loads the xml into the div. The client has requested a hyperlink to another page within the site, but from what I understand this may not be possible with xml?

    I've attached the javascript as .txt as it's pretty long.

    Below is the xml. I need question #3 to display a clickable hyperlink. I have tried for days and any help or advice is greatly appreciated.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <test>
        <questions>
            <question>
                <text>Do you live in Thurston County?</text>
                <answers>
                    <answer name="11" score="2" comb="">Yes</answer>
                    <answer name="12" score="0" comb="">No</answer>
                </answers>
            </question>
            <question>
                <text>Are you between the ages of 16-21?</text>
                <answers>
                    <answer name="21" score="2" comb="">Yes</answer>
                    <answer name="22" score="0" comb="">No</answer>
                </answers>
            </question>
            <question>
                <text>Do you think your income qualifies, according to the standards listed on our website? Please <a href="http://example.shtml" target="_blank">click here</a>to view the standards.</text>
                <answers>
                    <answer name="31" score="2" comb="">Yes</answer>
                    <answer name="32" score="0" comb="">No</answer>
                </answers>
            </question>
            <question>
                <text>Do ANY of the following apply to you: Criminal History, In or Aged Out of Foster Care, Member of a Migrant Family, Have a Documented Disability, Lack of Significant Work Experience or Other barrier to employment?</text>
                <answers>
                    <answer name="41" score="2" comb="">Yes</answer>
                    <answer name="42" score="0" comb="">No</answer>
                </answers>
            </question>
            <question>
                <text>Are you committed to working hard and staying connected with us for the next 18-24 months?</text>
                <answers>
                    <answer name="51" score="2" comb="">Yes</answer>
                    <answer name="52" score="0" comb="">No</answer>
                </answers>
            </question>
        </questions>
        <results>
    	
    	<!-- If all 5 questions are answered with "Yes" -->
    	
            <result name="yesToAll" minScore="10" maxScore="10">
                <redirect>http://example.shtml</redirect>
            </result>
    		
    	<!-- If ANY of the 5 questions are answered with "No" -->
    		
            <result name="default">
                <redirect>http://example.shtml</redirect>
            </result>
            
        </results>
        <local>
            <name>CareerTREK Eligibility Questionnaire</name>
            <header>Questions to go:</header>
            <resultHeader>Result:</resultHeader>
            <silentResult>Thanks!</silentResult>
        </local>
    </test>
    Attached Files Attached Files

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    I think you want to look up XLink.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • Users who have thanked Alex Vincent for this post:

    Diventare (06-14-2014)

  • #3
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,339
    Thanks
    11
    Thanked 288 Times in 287 Posts
    I just use cdata blocks for this:
    Code:
    <text><![CDATA[
    Do you think your income qualifies, according to the standards listed on our website? Please <a href="http://example.shtml" target="_blank">click here</a>to view the standards.]]</text>

  • Users who have thanked tracknut for this post:

    Diventare (06-14-2014)

  • #4
    New to the CF scene
    Join Date
    Jun 2014
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you both very much. Alex, I have looked into XLINK but I am not advanced enough to work it into the current script. Tracknut, I've tried using CDATA several times and unfortunately it breaks the quiz... meaning the quiz will not load into the div for some reason.

  • #5
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    How about showing us the full code for your injections?
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #6
    New to the CF scene
    Join Date
    Jun 2014
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    If you are willing, I could send you the entire quiz package as an attachment. You can even use it for yourself if you like
    Quote Originally Posted by Alex Vincent View Post
    How about showing us the full code for your injections?

  • #7
    New to the CF scene
    Join Date
    Apr 2014
    Location
    Pakistan
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You have little bit problems like Refresh your page after it will be able to run. Second option you have is clear cookies and run up files.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •