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 1851 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="lbrokercd" value="" onchange="doAction()"/>
My question is how to call a method inside a javascript function?.Acutally 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="lbrokercd" styleClass="dropdown"
value="${X32.lbrokercd}" onchange="doAction(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
---------------------------------------------------...
|
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....
|
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...
|
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";...
|
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...
| |
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.
...
|
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...
|
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...
|
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...
|
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,...
|
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...
| |
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
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...
|
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...
|
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 ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |