Calling a vbscript funciton to update a SQL table from an HTML form generated on an asp-classic page
Tag : html , By : Schmidt
Date : March 29 2020, 07:55 AM
it fixes the issue You're trying to mix server-side code with client-side code, and It Don't Work Like ThatTM. Here's a very rough outline of how you could get information from the user, process it, and display it, all on the same asp page. Note the utter lack of JavaScript. :) <html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="css/stylestuff.css">
<%
Dim rs, sql, conn
Dim mylist, myval1, myval2, i
myval1 = Request.Form("val1")
myval2 = Request.Form("val2")
'- If the form hasn't been submitted yet, myval1&2 will be the special value Empty,
'- but you can treat them as a blank string ("") for all intents and purposes.
If Validate(myval1, myval2) = True and myval1 & myval2 <> "" Then
DoStuffWith myval1, myval2
End If
%>
</head>
<body>
<h1>My Page</h1>
<form method="post" action="">
<p>Select one: <select name="val1" size="1">
<%
ListStuff mylist
For i = 0 to UBound(mylist,1)
response.write "<option value='" & mylist(0,i) & "'"
If myval & "" = mylist(0,i) & "" Then response.write " selected"
response.write ">" & mylist(1,i) & "</option>"
Next
%>
</select></p>
<p>Write something here:
<input type="text" name="val2" value="<%=myval2%>" size="10"></p>
<p><input type="submit" name="btn" value="Submit"></p>
</form>
<%
If myval1 & myval2 <> "" Then
DisplayStuff myval1, myval2
End If
%>
</body>
</html>
<%
Sub ListStuff(L)
sql = "Select [...] From [...] Where [...]"
Set rs = Server.Createobject("ADODB.Recordset")
rs.Open sql, "connection string (or previously-opened connection object)", 1,2
If Not rs.EOF Then
L = rs.GetRows
Else
Redim L(1,0)
L(0,0) = 0 : L(1,0) = "missing!"
End If
rs.Close
Set rs = Nothing
End Sub
'---------------------------------
Function Validate(v1,v2)
dim f
f = True
If Not Isnumeric(v1) Then f = False
If Len(v2) > 10 Then f = False
Validate = f
End Function
'---------------------------------
Sub DoStuffWith(v1,v2)
'- table-creation (or whatever) code goes here
End Sub
'---------------------------------
Sub DisplayStuff(v1,v2)
'- display code goes here
End Sub
%>
|
How to refresh a page on Ionic 3 (Ionic, Angular 5)
Date : March 29 2020, 07:55 AM
around this issue I’m building a favorite list which I can erase list items within a page. It’s based on Ionic sqlite storage. , Please Try this? this.navCtrl.setRoot(this.navCtrl.getActive().component);
|
Ionic 4 Angular 7 - passing object/data to another page
Date : March 29 2020, 07:55 AM
this one helps. I solved it using a service with a simple setter and getter just like in this question that I later found: import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class NavExtrasService {
extras: any;
constructor() { }
public setExtras(data){
this.extras = data;
}
public getExtras(){
return this.extras;
}
}
this.navExtras.setExtras(extras)
this.router.navigateByUrl('page-b');
this.location = navExtras.getExtras();
|
Passing 2D array to a funciton in c & c++
Tag : cpp , By : Nic Doye
Date : March 29 2020, 07:55 AM
may help you . I tried same program for C & C++ i.e. passing 2D array to a function. The following program is working in C, but not working in C++, Please explain why so ? , These statements int n;
scanf("%d",&n);
int arr[n][n];
|
Calling an function that is on an Ionic Angular page from a component in another file
Date : March 29 2020, 07:55 AM
should help you out For this specific need, you first need to understand how components communication work in angular. In angular components are well-defined, encapsulated units that can communicate with other components but through proper organized manner, not just randomly one components calling methods of other component.
|