Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
add attr in input tag
#1
I would like to add from Delphi the data-role attribute with the value "checkbox" in the input tag of an IWCheckBox. I was only able to create it in the span tag, but I need to put it in the input tag

Code:
procedure TFrmMain.IWCheckBox1HTMLTag(ASender: TObject; ATag: TIWHTMLTag);
begin
ATag.AddStringParam('data-role', 'checkbox');
end;
Code:
<span class="IWCHECKBOX1CSS" data-role="checkbox" data-type="IWCHECKBOX" id="IWCHECKBOX1">
<input id="IWCHECKBOX1_CHECKBOX" name="IWCHECKBOX1_CHECKBOX" type="CHECKBOX">
<span id="IWCHECKBOX1_CHKBCAPTION">IWCheckBox1</span></span>

I wish it was like this


Code:
<span class="IWCHECKBOX1CSS" data-type="IWCHECKBOX" id="IWCHECKBOX1">
<input id="IWCHECKBOX1_CHECKBOX" data-role="checkbox" name="IWCHECKBOX1_CHECKBOX" type="CHECKBOX">
<span id="IWCHECKBOX1_CHKBCAPTION">IWCheckBox1</span></span>
Reply
#2
Code:
procedure TIWForm1.dbCheckBoxHTMLTag(ASender: TObject; ATag: TIWHTMLTag);
var
  InputTag: TIWHTMLTag;
begin
  InputTag := ATag.Contents.FindTagByName('input') as TIWHTMLTag;
  // or InputTag := ATag.Contents[0] as TIWHTMLTag;
  InputTag.AddStringParam('data-role', 'checkbox');
end;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)