【问题标题】:Navigating forms using HTML?使用 HTML 导航表单?
【发布时间】:2017-03-29 20:01:18
【问题描述】:

有没有办法使用 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

所以,如果我想出了这样的事情,如果单击其中一个名称,GotoForm 会如何?

<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>

感谢

【问题讨论】:

    标签: smart-mobile-studio


    【解决方案1】:

    在 facebook 朋友的帮助下 :) 我想出了以下方法

    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;
    

    【讨论】:

      猜你喜欢
      • 2013-02-14
      • 1970-01-01
      • 1970-01-01
      • 2014-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-16
      相关资源
      最近更新 更多