Off Beat Question - Javascript - SQL

Re: Off Beat Question - Javascript - SQL

Postby cdmmaui » Sat May 25, 2013 3:13 pm

Hi Antonio,

It did not seem to work, I typed in data and expect field to automatically populate. I can send you e-mail with login details so you can view if you'd like. Please let me know.
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Off Beat Question - Javascript - SQL

Postby Antonio Linares » Sat May 25, 2013 8:12 pm

Darrell,

Could you post here some portion of the code so we can all review it ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42092
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Off Beat Question - Javascript - SQL

Postby cdmmaui » Tue Jun 04, 2013 2:01 pm

Hi Antonio,

Sorry for the delay getting back to you, I was traveling. Here is the sample code, I would appreciate any assistance.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<script>
function RowOver(RowColor) { RowColor.style.backgroundColor="#ffffff"; }
function RowOut(RowColor) { RowColor.style.backgroundColor="#000000"; }
function AgentRec(Param){ location.href='sirec.dll?'+Param; }
</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CDM Software Solutions, Inc. </title>
<link REL="SHORTCUT ICON" HREF="http://www.cdmsoft.com/cdm2.ico">
</head>

<body>
<body bgcolor="#FFFFFF">

<script>] )
function consignee() {] )

var consid = document.getElementById("consid").value;
var consname = document.getElementById("consname");
var consadd1 = document.getElementById("consadd1");
var consadd2 = document.getElementById("consadd1");
var conscity = document.getElementById("conscity");
var consst = document.getElementById("consst");
var conszip = document.getElementById("conszip");
var consiso = document.getElementById("consiso");

try
{
var connection = new ActiveXObject("ADODB.Connection");] )
}
catch(e)
{
alert("ADODB namespace not found.");
exit(0);
}

try
{
var connectionstring="DSN=Pasha;User ID=sa;Password=Alex1209$;
connection.Open(connectionstring);
}
catch(e)
{
alert(e.message);
exit(0);
}

var rs = new ActiveXObject("ADODB.Recordset");

alert(consid);

rs.Open("SELECT * FROM agent WHERE agentid='"+consid+"'", connection);
if(!rs.eof)
{
consname.value=(rs.fields("name"));
}

alert(consname.value);

rs.close;
connection.close;

}
</script>

<form action="/bkgmgr/sisave.dll" method="POST">

<table width="100%" cellpadding=5 cellspacing=0 align="center" border=1 bordercolor="#ffffff">

<tr>
<td><font size=2>Code</font></td>
<td><input type=text id="consid" name="CONSID" size=10 maxlength=10 onchange="consignee()"></td>
</tr>

<tr>
<td><font face="' + cTtlFnt + '" color=' + cDE01 + ' size=2>Name</font></td>
<td><input type=text id="consname" name="CONSNAME" size=55 maxlength=55 /></td>
</tr>' )

<tr>
<td><font size=2>Address</font></td>
<td><input type=text name="CONSADD1" size=40 maxlength=55><br>
<input type=text name="CONSADD2" size=40 maxlength=55><br>
<input type=text name="CONSADD3" size=40 maxlength=55><br>
<input type=text name="CONSCITY" size=40 maxlength=55></td>
</tr>' )

<tr>
<td><font size=2>State/Province</font></td>
<td><input type=text name="CONSST" size=10 maxlength=10></td>
</tr>

<tr>
<td><font size=2>Zipcode</font></td>
<td><input type=text name="CONSZIP" size=10 maxlength=10></td>
</tr>' )

<tr>' )
<td><font face="' + cTtlFnt + '" color=' + cDE01 + ' size=2>Country</font></td>
<td><select name="CONSISO">
<option value="US">US</option>
</select></td>
</tr>

</table>

<input type="button" name="B1" value="C A N C E L" style="border:1 solid #CDCDCD; font-family: tahoma,Verdana; height: 29; position: relative; color:#111111; padding-left:4px; padding-right:4px; padding-top:4; padding-bottom:4; background-color:#DCDCDC" onClick="history.go(-1)">
<input type="submit" name="A1" value="C O N T I N U E" style="border:1 solid #CDCDCD; font-family: tahoma,Verdana; height: 29; position: relative; color:#111111; padding-left:4px; padding-right:4px; padding-top:4; padding-bottom:4; background-color:#DCDCDC">
</form>


</body>
</html>
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: jmartial and 76 guests