Click here to Skip to main content
15,904,655 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: var RVIPath = RVIPath || {}; Pin
Richard MacCutchan23-Jul-12 7:06
mveRichard MacCutchan23-Jul-12 7:06 
GeneralRe: var RVIPath = RVIPath || {}; Pin
BobJanova23-Jul-12 23:25
BobJanova23-Jul-12 23:25 
GeneralRe: var RVIPath = RVIPath || {}; Pin
Richard MacCutchan23-Jul-12 23:42
mveRichard MacCutchan23-Jul-12 23:42 
GeneralRe: var RVIPath = RVIPath || {}; Pin
Andy Brummer9-Aug-12 10:38
sitebuilderAndy Brummer9-Aug-12 10:38 
GeneralRe: var RVIPath = RVIPath || {}; Pin
Richard MacCutchan9-Aug-12 22:23
mveRichard MacCutchan9-Aug-12 22:23 
GeneralRe: var RVIPath = RVIPath || {}; Pin
Andy Brummer10-Aug-12 5:03
sitebuilderAndy Brummer10-Aug-12 5:03 
AnswerRe: var RVIPath = RVIPath || {}; Pin
J4amieC23-Jul-12 5:13
J4amieC23-Jul-12 5:13 
QuestionI get "ReferenceError:'myreq' is undefined" error for <textarea> variable? Pin
creative2619-Jul-12 7:09
creative2619-Jul-12 7:09 
CSS
Hi all;

I have an ActiveX control that use it's functionality in a html file, so that I call it's methods and properties

using a javascript function as below:

HTML
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">

fieldset {
  border-color: #000;
  border-width: 3px;
  border-style: solid;
  padding: 10px;
  margin: 0;
  min-width: 400px;
  max-width: 800px;
  width: 800px; 
}

fieldset legend {
            color: blue
	font-size: 1.1em; 
}

fieldset label:first-letter {
	text-decoration: underline;   
}

input, textarea, select {
	width: auto;
	margin: 5px 0 0 10px;
}

.style1
{
    width: 25%;
}
.style2
{   
    color: #0000CC;
    font-weight: 700;
}
.style3
{
    width: 213px;
}
</style>

<script type="text/javascript">

function OnGenReq()
{
     
   var ret = MyOCX.GenerateReq(Text1.value, Text2.value, Text3.value, length1.value, Text4.value);
   document.getElementById("demo").innerHTML=ret;

   myreq.value = MyOCX.ReqString;
   //document.getElementById("myreq").value = MyOCX.ReqString;
   //document.getElementById("myreq").innerHTML = "teststring";

}
</script>
</head>

<body>
<p id="demo"></p>
<object id="MyOCX" width="0" height="0" codebase="C:\Users\Administrator\Documents\Activex.cab"
 classid="clsid:8F91127E-A84B-4FBD-AB43-AA63A63C0BE5">
    <param name="_Version" value="65536">
    <param name="_ExtentX" value="2646">
    <param name="_ExtentY" value="1323">
    <param name="_StockProps" value="0">
</object>
<p></p>

<fieldset>
<legend class="style2">Generate Request:</legend>

<label for="Text1">First string Arg:</label><input id="Text1" type="text"><br>
<label for="Text2">Second string Arg:</label><input id="Text2" type="text"><br>
<label for="Text3">Third string Arg:</label><input id="Text3" type="text"><br>
<label for="length1">Length value:</label> 
<select id="length1"> 
  <option selected="selected" value="100">100</option>
  <option value="200">200</option>
  <option value="300">300</option>
</select><br>
<label for="Text4">Forth string Arg:</label><input id="Text4" size="30" type="text"><br><br>

<label for="gen"></label><input id="gen" value="Generate Request" type="button" onclick="try{OnGenReq()}catch(e)

{alert(e)}"><br><br>
<center> 
<label for="myreq">Req String</label><br><textarea id="myreq" rows="15" cols="66"></textarea><br><br>
</center>
</fieldset>

</body>
</html>

As you see in the html code, I have a tag with "myreq" id that want to display "ReqString" value (that

is a custom property of the activex) into textarea.

When I click "Generate Request" button, "MyOCX.GenerateReq" method runs to assign a string value to "ReqString"

property. But when I assign "MyOCX.ReqString" value to "myreq" to be displayed in the textarea using either:

myreq.value = MyOCX.ReqString;

OR

document.getElementById("myreq").value = MyOCX.ReqString;

I get the error "ReferenceError:'myreq' is undefined", while "myreq" is defined within the <fieldset> tag!

Could you tell me what's wrong with this code?

TIA.
AnswerRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
jkirkerx19-Jul-12 8:42
professionaljkirkerx19-Jul-12 8:42 
AnswerRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
enhzflep22-Jul-12 19:51
enhzflep22-Jul-12 19:51 
GeneralRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
Peter_in_278022-Jul-12 20:07
professionalPeter_in_278022-Jul-12 20:07 
GeneralRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
enhzflep22-Jul-12 20:19
enhzflep22-Jul-12 20:19 
GeneralRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
Peter_in_278022-Jul-12 20:30
professionalPeter_in_278022-Jul-12 20:30 
GeneralRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
enhzflep22-Jul-12 20:39
enhzflep22-Jul-12 20:39 
GeneralRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
Peter_in_278022-Jul-12 20:55
professionalPeter_in_278022-Jul-12 20:55 
GeneralRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
enhzflep24-Jul-12 7:28
enhzflep24-Jul-12 7:28 
GeneralRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
Peter_in_278024-Jul-12 13:20
professionalPeter_in_278024-Jul-12 13:20 
GeneralRe: I get "ReferenceError:'myreq' is undefined" error for variable? Pin
enhzflep24-Jul-12 19:06
enhzflep24-Jul-12 19:06 
GeneralStop a page moving upwards Pin
offroaderdan18-Jul-12 23:24
offroaderdan18-Jul-12 23:24 
GeneralRe: Stop a page moving upwards Pin
jkirkerx19-Jul-12 8:36
professionaljkirkerx19-Jul-12 8:36 
QuestionHow to develop Smart TV Apps? Pin
prithveesh.goel17-Jul-12 0:22
prithveesh.goel17-Jul-12 0:22 
QuestionRe: How to develop Smart TV Apps? Pin
markovl17-Jul-12 0:36
markovl17-Jul-12 0:36 
AnswerRe: How to develop Smart TV Apps? Pin
prithveesh.goel17-Jul-12 20:56
prithveesh.goel17-Jul-12 20:56 
AnswerRe: How to develop Smart TV Apps? Pin
Richard MacCutchan17-Jul-12 2:50
mveRichard MacCutchan17-Jul-12 2:50 
GeneralRe: How to develop Smart TV Apps? Pin
prithveesh.goel17-Jul-12 20:57
prithveesh.goel17-Jul-12 20:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.