2017-03-29 2 views
1

HTMLを使用して別のフォームに移動する方法はありますか?HTMLを使用してフォームをナビゲートしますか?

例えば、サイドでのリンク私のinnerHTMLプロパティ

<a href="goto form 2 here">Form2</a> 

は、それは私がTW3ScrollControlのinnerHTMLプロパティにハードコーディングされただけのHTMLです。 HTMLの中には、いくつかは、動的データ(例えば、質問&答え)私は私のJSONファイルから取得され、静的である

、どのようにオフに私の頭の上にこのような何かを与えて

Who is the president of the United States? 


    Hillary Clinton 
    Bernie Sanders 
    Joseph Biden 
    Donald Trump 

ので、例えば

、これらの名前の1つがクリックされた場合、GotoFormを実行しますか? Facebookの友人から少し助けを借りて

<div> 
    <p>Who is the president of the United States?</p> 
    <br> 
    <center> 
    <A href=""> Hillary Clinton </A><br> 
    <A href=""> Bernie Sanders </A<br> 
    <A href=""> Joseph Biden </A<br> 
    <A href=""> Donald Trump </A<br> 
    </center> 
</div> 

ありがとう

答えて

1

:)私は、次の

var i: integer; 
     IdStr: String; 
begin 
fQuestion.content.InnerHTML:= '<div style="text-align: center; position: relative;">' + 
    '<br><center><p>' + fQuestions.questions[fIndex].question + '</p></center><br>' + 
    '<center>' + 
    '<A id="answer1" href="">' + fQuestions.questions[fIndex].answers[0] + '</A><br>' + 
    '<A id="answer2" href="">' + fQuestions.questions[fIndex].answers[1] + '</A><br>' + 
    '<A id="answer3" href="">' + fQuestions.questions[fIndex].answers[2] + '</A><br>' + 
    '<A id="answer4" href="">' + fQuestions.questions[fIndex].answers[3] + '</A><br>' + 
    '</center>' + 
    '</div>'; 


    for i:= 1 to 4 do 
    begin 
    IdStr:= 'answer' + intToStr(i); 
    var h:= BrowserAPI.Document.getElementById(idStr); 
    if (h) then 
    begin 
    h.onclick := procedure (ev: variant) 
    begin 
     //do something here 
    end; 
    end; 
end; 
end; 
を思い付くことができました
関連する問題