Navigating forms using HTML? - smart-mobile-studio

is there a way to navigate to another form using HTML ?
for example, a link in side my innerHTML
Form2
it is just HTML i was hardcoding into the innerHTML property of a TW3ScrollControl. Some of the HTML is static, some is dynamic data (e.g. question & answer) I get from my JSON file
for example
Who is the president of the United States?
Hillary Clinton
Bernie Sanders
Joseph Biden
Donald Trump
so, giving something like this off the top of my head, how would on do a GotoForm if one of these names were clicked?
<div>
<p>Who is the president of the United States?</p>
<br>
<center>
Hillary Clinton <br>
<A href=""> Bernie Sanders </A<br>
<A href=""> Joseph Biden </A<br>
<A href=""> Donald Trump </A<br>
</center>
</div>
thanx

with a little help from facebook friend :) I was able to come up with the following
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;

Related

Barcode CODE_128 using PrintHTML with Qz Tray

Good Day All,
Right now, i'm trying to print using HTML with Qz-Tray. Can i make a barcode on that template HTML. The Problem is, that HTML template is STRING so it can not be change it using Javascript and I'm Trying to use Libre Font 128 Font Family but still not working.
https://www.w3schools.com/howto/tryit.asp?font=Libre%20Barcode%20128 i want to use that library, in this
function printHTML() {
var config = getUpdatedConfig();
var colA = '<h2>* QZ Print Plugin HTML Printing *</h2>' +
'<span style="color: #F00;">Version:</span> ' + qzVersion + '<br/>' +
'<span style="color: #F00;">Visit:</span> https://qz.io/';
var colB = '<img src="' + getPath() + '/assets/img/image_sample.png">';
var printData = [
{
type: 'html',
format: 'plain',
data: '<html>' +
' <table style="font-family: monospace; border: 1px;">' +
' <tr style="height: 6cm;">' +
' <td valign="top">' + colA + '</td>' +
' <td valign="top">' + colB + '</td>' +
' </tr>' +
' </table>' +
'</html>'
}
];
qz.print(config, printData).catch(displayError);
}
or this https://barcode-coder.com/en/barcode-jquery-plugin-201.html

Response.Write Horizontal Table from SQL Query using Dataview

Still need help, no answer that has worked yet. Please jump in if you have any ideas.
I have been trying to get my Response.Write to go Horizontal, however I cannot seem to figure it out.
This is what I currently have (it all sits within a table) and loads from an sql database query using Dataview to get the vehicles I want to display:
Response.Write("<tr><td width='200px' colspan='3'><a href='car.aspx?invno=" & invno & "'><image runat='server' src='" + imageurl + "'></image></a></td></tr>")
Response.Write("<tr><td width='5px'>" + year + "</td><td width='10px'>" + make + "</td><td width='100px'>" + model + "</td></tr>")
Response.Write("<tr><td width='200px' colspan='3'>" + mileage + "</td></tr>")
However it is Currently giving me this Picture 1
But what I really want is this Picture 2
Any help would be greatly appreciated
Update
Ok so I am editing this whole post, as it was overly complicated with what I want. So I am breaking it down to its simplest:
</head>
<body>
<form id="form1" runat="server">
<asp:SqlDataSource runat="server" id="sqldata" ConnectionString="<%$ ConnectionStrings:cars %>" SelectCommand="SELECT TOP 3 ORDER BY NEWID() )">
</asp:SqlDataSource>
<asp:Panel ID="Panel1" runat="server">
<div style="font-size: 10px; font-family: 'arial';">
<center>
<table id="list" border="0" cellpadding="2" cellspacing="0" width="200px">
<%
Dim dv As Data.DataView = CType(sqldata.Select(DataSourceSelectArguments.Empty), Data.DataView)
For Each dr As Data.DataRow In dv.Table.Rows
Dim make As String = dr("make")
Response.Write("<tr><td>" + make + "</td></tr>")
Next
%>
</table>
</center>
</div>
</asp:Panel>
</form>
</body>
</html>
So with the code above.. I get a vertical list
Ford
Chevy
Toyota
But what I want is a Horizontal list
Ford Chevy Toyota
Create a single row with 3 different columns to achieve your desired result
Response.Write("<tr><td width='200px' colspan='3'><a href='car.aspx?invno=" & invno & "'><image runat='server' src='" + imageurl + "'></image></a></td>")
Response.Write("<td width='5px'>" + year + "</td><td width='10px'>" + make + "</td><td width='100px'>" + model + "</td>")
Response.Write("<td width='200px' colspan='3'>" + mileage + "</td></tr>")

Bootstrap media object cannot align properly

I am using Bootstrap 3 media objects and I have this code here dynamically I want to have 4 columns in one row,but the problem is that the last row will have spaces inbetween to the second row.
here is my code.
//content.php
for(var i=0;i<12;i++){
mymdedia+=
'<div class="media col-sm-3">'+
'<div class="media-left">'+
'<a href="#">'+
'<img src=".....">'+
'</a>'+
'</div>'+
'<div class="media-body">'+
'<h4 class="media-heading">'John Doe'</h4>'+
'<p>Live: '+data[i].address+'</p>'+
'</div>'+
'</div>';
}
$('#mycontainer').append(mymdedia);
//index.php
<div class="someclass">
<div class="row" id="mycontainer">
</div>
</div>
and this is the result looks like
I believe you are placing all the media objects in one row ... and they don't fit.
In every row that you've opened ( <div class='row'>...</div> ) you can place only 4 <div class='media col-sm-3'></div> ... because each col size = 3 ... ( 4x3 = 12 )
So in the for loop, after each 4 media objects - you should close the current row div and create a new <div class='row'> ...
See plunker: http://plnkr.co/edit/BJa3qdbKcYMDwhW809gp?p=preview
Right after the for loop:
for(var i=0;i<12;i++){
if ( i && i % 4 == 0 )
mymdedia += '</div><div class="row">'; // close row and create a new one
... your original code ...
}
mymdedia += '</div>' // close the last row outside the for loop ...

XPath for child element

What is the Xpath to select the first element of this jquery selector: $('.A .B:eq(1)') ?
HTML Sample
<div class="x A z">
<div class="y">
<div class="r B z"></div> <---- that is that I need to select
<div class="r B z"></div
>
...
So far I've tried this:
(//div[(#class='A') and div[contains(concat(' ', #class, ' '), 'B')]])[1]
//div[contains(concat(' ',#class,' '), ' A ')]//div[contains(concat(' ',#class,' '), ' B ')][1]

kendo scheduler event template

Hi I would like to add a Kendo ToolTip inside the kendo Scheduler event template. When ever i add any Html helper it throws invalid template error. I might be missing some the syntax.Can anyone suggest the way to do it?
d.EventTemplate(
"<div style='height: auto !important;'>"+
"#=kendo.toString(start,'hh:mm')# #= kendo.toString(start,'tt')# #"+
"<span style='font-size:smaller'>#= PickStopName# </span> " +
"##(Html.Kendo().Tooltip().For('#Scheduler').Width(250)"+
".Content('# <div style='text-align:justify;'>" +
"<div>" +
"<h6> #= title# </h6>" +
"<h6> #= description# </h6>" +
"<h4> #= kendo.toString(start,'hh:mm')# </h4>" +
"</div>" +
"</div>)'#)#"+
"</div>"
);