hi,
Below getRimData() is a function which will call .js file. It is included in -
<html:select property="lbrokercd" value="" onchange="document.forms[0], '/ILICTreasury/banker-web/X32.do', this, 'IX3201')">
-
---------> IT IS WROKING WELL
<head> -
function doAction(){
-
getRimData(document.forms[0], '/ILICTreasury/banker-web/X32.do',
-
this, 'IX3201');
-
}
-
</head>
-
<body>
-
-
<html:select property="lbrokercd" value="" onchange="doAction()" ----------> it is not calling getRimData ();
-
<body>
-
when ever the "doAction" is called it should execute the function "getRimData()". . but it is showing some error.
thx
HAN
5 1862 gits 5,390
Recognized Expert Moderator Expert
hi ...
at least you have to pass the this-variable to your function because getRimData awaits it: - onchange="doAction(this);"
kind regards
hi,
i have alerady passed the 'this' in that but i am getting same error again
hi,
while copying from my page it just not copied.... the code is like this....
<html:select property="lbrok ercd" value="" onchange="doAct ion()"/>
My question is how to call a method inside a javascript function?.Acuta lly my idea is as below. -
<html>
-
<head>
-
<script language="javascript" src="../../js/module.js"></script>
-
<script language="javascript">
-
function domyAction(){
-
onemoreAction('arg1','arg2','arg3','arg4'); //-------> this described in .js file
-
}
-
</script>
-
</head>
-
<body>
-
<select onchange="domyAction()">
-
<option value ="volvo">Volvo</option>
-
<option value ="saab">Saab</option>
-
<option value ="opel">Opel</option>
-
<option value ="audi">Audi</option>
-
</select>
-
</body>
-
</html>
-
-
thx,
Ajay
gits 5,390
Recognized Expert Moderator Expert
hi ...
i cannot see where you pass the this to your doAction-function ... however: have a look at the following example: -
<html>
-
<head>
-
<script type="text/javascript">
-
-
function test(val) {
-
alert(val);
-
}
-
-
function domyAction(obj) {
-
test(obj.value);
-
}
-
-
</script>
-
</head>
-
<body>
-
<select onchange="domyAction(this)">
-
<option value ="volvo">Volvo</option>
-
<option value ="saab">Saab</option>
-
<option value ="opel">Opel</option>
-
<option value ="audi">Audi</option>
-
</select>
-
</body>
-
</html>
-
kind regards
i am giving tow code's of two files.
Case1,Case 2
in case1 my code is working fine but not working in case2... why?
In Case1 i placed my function getRimData() in 'onChange()',
bue in Case 2 i place in javascript function. what is the difference? - case 1:--->html:select onChange one javascript method is calling and it is wroking fine but i want, like case2:
-
-
case1:
-
------
-
<body>
-
<html:select property="lbrokercd" styleClass="dropdown" value="${X32.lbrokercd}" onchange="getRimData(document.forms[0],'/ILICTreasury/banker-web/X32.do',this, 'IX3202');">
-
<html:option value="">Please Select</html:option>
-
<html:option value="1">1- HIDRO</html:option>
-
<html:option value="2">2- BI-HIDRO</html:option>
-
<html:option value="3">3- DI-HIDRO</html:option>
-
<html:option value="4">4- N-HIDRO</html:option>
-
</html:select>
-
-
</body>
-
-
-
--------------------------------------------------------------------------------------------------
-
-
-
-
case2:
-
-
<script>
-
-
function doAction(){
-
getRimData(document.forms[0],'/ILICTreasury/banker-web/X32.do',this, 'IX3202');
-
}
-
-
</script>
-
-
<body>
-
<html:select property="lbrokercd" styleClass="dropdown" value="${X32.lbrokercd}" onchange="doAction()">
-
<html:option value="">Please Select</html:option>
-
<html:option value="1">1- HIDRO</html:option>
-
<html:option value="2">2- BI-HIDRO</html:option>
-
<html:option value="3">3- DI-HIDRO</html:option>
-
<html:option value="4">4- N-HIDRO</html:option>
-
</html:select>
-
-
</body>
-
gits 5,390
Recognized Expert Moderator Expert
as i said ... have a look at the this-keyword ... it is a reference to the actual object in your case and you don't pass it to the doAction() function so getRimData() has another this as it needs!!!!! pass 'this' from the onchange to getRimData through the entire chain of calls! try the following:
[HTML]<script>
function doAction(obj) {
getRimData(
document.forms[0],
'/ILICTreasury/banker-web/X32.do',
obj,
'IX3202'
);
}
</script>
<body>
<html:select property="lbrok ercd" styleClass="dro pdown"
value="${X32.lb rokercd}" onchange="doAct ion(this)">
<html:option value="">Please Select</html:option>
<html:option value="1">1- HIDRO</html:option>
<html:option value="2">2- BI-HIDRO</html:option>
<html:option value="3">3- DI-HIDRO</html:option>
<html:option value="4">4- N-HIDRO</html:option>
</html:select>
</body>
[/HTML]
kind regards
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Greg Brant |
last post by:
my script is
document.write("<!-- #include
virtual\"http://www.where-ever.com/whatevere.html\" -->")
but in the html (view source) i get
---------------------------------------------------
<script language="Javascript" type="text/Javascript">
document.write("\
|
by: Bruce |
last post by:
I have sucessfully used document.write in a new window, but I now wish
to write to an already open & framed window. How do I do it. Please
show example, as I have trouble getting my head around JS.
TIA
Bruce
|
by: Stumped and Confused |
last post by:
Hello,
I really, really, need some help here - I've spent hours trying to find a
solution.
In a nutshell, I'm trying to have a user input a value in form's
textfield. The value should then be assigned to a variable and output
using document.write.
(Note, there is no submit button or other form elements. Basically
|
by: TJS |
last post by:
what is wrong here, the submit will only post page back to itself instead of
specifed action
<SCRIPT language="Javascript">
function Submit_Form(){
document.Form1.Action="cart.asp";
document.Form1.submit();
return false;
}
</SCRIPT>
|
by: francisco lopez |
last post by:
I hope not sent I twice.
ok here is my problem,
the javascript form validation works perfect during I put a
emaildirection in the <form action:""> comand, like this:
<form action="mailto:butacasalada@gmx.net" method="post"
name="formulario"
id="formulario" onSubmit="return chkFormular()">
| |
by: Paul Thompson |
last post by:
I am working with a special tool which pre-processes the page. Using
document.write, I am composing the page while it is loading, so I need
to force a reprocess of the page AFTER the page loads.
Is there some way to do that? That is, I want the browser to
essentially act as if the composed page was the original page.
Here is a brief version of the page construction technique:
|
by: Mark Miller |
last post by:
I've been trying to execute a javascript function just before submit on a
form that contains an <input type="file"> input field and it isn't working.
The reason I want to do this is the end users will be uploading files that
are between 1 and 2 Meg. in size, and they are not too knowledgeable about
computers. I want to disable the form buttons so they can't hit them after
they hit the "upload" button. We're trying to prevent them from...
|
by: Angelos |
last post by:
Hello there,
I am very new to Javascript and before I explain what I want I'll tell
you in a few words that I am trying to make a button on a WYSIWYG text
editor (RichArea) that previews on a template the content of the editor
and not in just an empty page.
I can't get around the folowing:
I have a page with a form and a text area. In the textarea I write html
code or any text.
|
by: Notgiven |
last post by:
This works:
<input type="button" value="Add to list" onClick="addOption(param1,
param2);">
But this doesn't:
<img src="images/add.gif" onClick="addOption(param1, param2);">
The error I get using the img tag is, "this.form has no properties". Yet it
is right beside the input tag that does work with the same OnClick= params
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |