codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  calling javascript function in asp page  mayadevi at 09:11 on Thursday, June 21, 2007
 

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


  Re: calling javascript function in asp page  dentarp at 14:48 on Thursday, June 21, 2007
 

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>

  Re: calling javascript function in asp page  mayadevi at 08:12 on Monday, June 25, 2007
 

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

  Re: calling javascript function in asp page  dentarp at 12:11 on Monday, June 25, 2007
 

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








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem
•  Re: import contacts of msn/yahoo
•  Cookies and Threads C++
•  right justify a background in a table?
•  Help with Loop (C++/MFC)
•  Help with Loop (C++/MFC)


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007