|
hiii all....
can anyone help me?
i have an asp page with vbscript as default language
i want to call a javascript function on onclick or onchange event
my code is just like this
<%@ Language=VBScript %>
///some vbscript
<head>
<script language="javascript">
function jsproc()
{
Response.Write("tyfuygjhkjhkjghgfhgfghf")
}
</script>
</head>
<body>
<input name="amount" type="text" maxlength="25" size="20" onChange="jsproc()"/>
</body>
can anyone give me a help?
plz explain how can i do this...and wats wrong in my code
thanks
Maya
|
|
|
Maya,
You are trying to perform a server-side action (response.write)inside a block of client-side code. You Try the code below as an
alternative.
<%@ Language=VBScript %>
<head>
<script language="javascript">
function jsproc()
{
var strtext = "tyfuygjhkjhkjghgfhgfghf"
var obj = document.getElementById("div1")
obj.innerHTML = strtext
//if you use document.write() it will erase the entire page
so it is better to dynamically fill a designated section
}
</script>
</head>
<body>
<div id="div1"> </div>
<p>
<input name="amount" type="text" maxlength="25" size="20" onChange="jsproc()"/>
</p>
</body>
|
|
|
thank u
can u help me for solving this problem?
i have an asp page billentry.asp
my prob is....
i have a combo box in my form i want to populate it from database...
it contains debtors name....
but i need debtors code for taking corresponding values from database...
i can do it with onchange submission of form on combobox
can i do it without onchange=submit????
nd the second prob is
am populating a table according to this combobox value...
i can populate it...
the problem is...
this table contains check boxes
i want to send the checked values of table to access database
how can i do this?
plzzzzzzzzzzz help me
|
|
|
Mayadevi,
The form needs to submitted in one way or another, whether through an onchange event, onsubmit event or
manually clicking a form button if you need to retrieve the value of one of its elements to use in a database query.
Checkboxes are OK to display a table but bad as far as
sending values in a form because if a checkbox is not checked it does not send anything to the processing page.
You typically need to have a hidden form field that applies to each of the checkboxes and before the form is submitted check the status of each of the checkboxes and
fill in the hidden field accordingly. Simply send a 0 for
unchecked or -1 for checked if you are using MS Access.
Denis
|
|
|