Solved

submit onblur does not work

Posted on 2011-09-27
4
291 Views
Last Modified: 2012-05-12
Hi I've got this script and I need to submit the value entered in a field with an onblur event.
This should work for three textarea boxes

But It does not work. What am I doing wrong?  
<!--#INCLUDE FILE="config.asp"-->
<%

Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT TOP(1) * FROM L3_informatie ORDER BY id DESC;", CS, 3, 4
algemeen = rs("algemeen")
wachtkamer = rs("wachtkamer")
patienten = rs("patienten")
rs.Close
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT TOP(1) * FROM L3_belangrijkenummers ORDER BY id DESC;", CS, 3, 4
%>
<html>
<head>
</head>
<body>
<form method="Post" name="default" action="default_post.asp">
<table border=1>
<tr>
	<td rowspan="15" valign=topn >Algemene informatie/Belangrijk: </td>
	<td rowspan="15"><textarea name="algemeen" cols="120" rows="15" onblur="document.default.submit()"><%= response.write (algemeen) %></textarea></td>
	<td colspan="5" align="center"><h3>Belangrijke nummers:</h3></td>
</tr>
<tr>
	<td colspan="5"><b><i>Afdeling specifiek</i></b></td>
</tr>
<tr>
	<td width="40"></td>
	<td width="140"><b>functie</b></td>
	<td width="200"><b>naam</b></td>
	<td width="80"><b>telefoon nr.</b></td>
	<td><b>pieper nr.</b></td>
</tr>
<tr>
	<td></td><td>Supervisor :</td>
	<td width="200"><%= rs("superv_naam") %></td>
	<td><%= rs("superv_tel") %></td>
	<td><%= rs("superv_piep") %></td>
</tr>
<tr>
	<td></td>
	<td>Achterwacht :</td>
	<td><%= rs("achterw_naam") %></td>
	<td><%= rs("achterw_tel") %></td>
	<td><%= rs("achterw_piep") %></td>
</tr>
<tr>
	<td></td>
	<td>Regie. :</td>
	<td><%= rs("regie_naam") %></td>
	<td><%= rs("regie_tel") %></td>
	<td><%= rs("regie_piep") %></td>
</tr>
<tr>
	<td></td>
	<td>Verpl. :</td>
	<td><%= rs("eersteverpl_naam") %></td>
	<td><%= rs("eersteverpl_tel") %></td>
	<td><%= rs("eersteverpl_piep") %></td>
</tr>
<tr>
	<td></td>
	<td>Verpl. :</td>
	<td><%= rs("tweedeverpl_naam") %></td>
	<td><%= rs("tweedeverpl_tel") %></td>
	<td><%= rs("tweedeverpl_piep") %></td>
</tr>
<tr>
	<td colspan="5"></td>
</tr>
<tr>
	<td rowspan="16" valign=topn >Wachtkamer: </td>
	<td rowspan="16"><textarea name="wachtkamer" cols="120" rows="16" onblur="document.default.submit()"><%= response.write (wachtkamer) %></textarea></td>
	<td colspan="5"><b><i>Spoed sectio</i></b></td>
</tr>
<tr>
	<td width="40"></td>
	<td colspan="2"><b>functie</b></td>
	<td width="200"><b>1e tel. nr.</b></td>
	<td><b>2e tel. nr.</b></td>
	<td></td>
</tr>
<tr>
	<td></td>
	<td colspan="2">OK Anesthesist :</td>
	<td width="200"><%= rs("OK_anesth_tel1") %></td>
	<td><%= rs("OK_anesth_tel2") %></td>
</tr>
<tr>
	<td width="40"></td>
	<td colspan="2"></td>
	<td width="200"><b>tel. dag</b></td>
	<td><b>tel. nacht</b></td>
</tr>
<tr>
	<td></td>
	<td colspan="2">OK Verpleegk. :</td>
	<td width="200"><%= rs("OK_verpl_teldag") %></td>
	<td><%= rs("OK_verpl_telnacht") %></td>
</tr>
<tr>
	<td width="40"></td>
	<td colspan="2"></td>
	<td width="200"><b>tel. dag</b></td>
	<td><b>tel. nacht/weekend</b></td>
	<td></td>
</tr>
<tr>
	<td></td>
	<td colspan="2">Kinderarts :</td>
	<td width="200"><%= rs("kinderarts_dag") %></td>
	<td><%= rs("kinderarts_nacht_weekend") %></td>
</tr>
<tr>
	<td></td>
	<td colspan="2">Spoedbloed bestellen :</td>
	<td colspan="2" width="200"><%= rs("spoedbloed") %></td>
</tr>
<tr>
	<td></td>
	<td colspan="2">Reanimatiesein :</td>
	<td colspan="2" width="200"><%= rs("reanimatiesein") %></td>
</tr>
<tr>
	<td rowspan="16" valign=topn >Te verwachten patienten: </td>
	<td rowspan="16"><textarea name="patienten" cols="120" rows="16" onblur="document.default.submit()"><%= response.write (patienten) %></textarea></td>
	<td valign="top" align="center" colspan="5"><INPUT id="subbut" name="subbut" type="submit" value="Nummers wijzigen"></td>
</tr>
</table>
</form>
</body>
</html>

Open in new window

0
Comment
Question by:Steynsk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 500 total points
ID: 36708924
The used form name "default" is an reserved word. Name it slightly different.

Also better practice is to give the full path like this:
onblur="document.forms.default2.submit()"

Open in new window


0
 
LVL 8

Expert Comment

by:jawa29
ID: 36708929
Hi

Try giving your form an ID value.
<form method="Post" name="default" id="default" action="default_post.asp">

Jawa29
0
 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36709203
Check this

<!--#INCLUDE FILE="config.asp"-->
<%

Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT TOP(1) * FROM L3_informatie ORDER BY id DESC;", CS, 3, 4
algemeen = rs("algemeen")
wachtkamer = rs("wachtkamer")
patienten = rs("patienten")
rs.Close
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT TOP(1) * FROM L3_belangrijkenummers ORDER BY id DESC;", CS, 3, 4
%>
<html>
<head>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
  <script>
$(document).ready(function(){
      $(".classtxtarea").blur(function(){
        document.defaultform.submit();

      });

});
</script>
</head>
<body>
<form method="Post" name="defaultform" action="default_post.asp">
<table border=1>
<tr>
  <td rowspan="15" valign=topn >Algemene informatie/Belangrijk: </td>
  <td rowspan="15"><textarea name="algemeen" cols="120" rows="15" class="classtxtarea"><%= response.write (algemeen) %></textarea></td>
  <td colspan="5" align="center"><h3>Belangrijke nummers:</h3></td>
</tr>
<tr>
  <td colspan="5"><b><i>Afdeling specifiek</i></b></td>
</tr>
<tr>
  <td width="40"></td>
  <td width="140"><b>functie</b></td>
  <td width="200"><b>naam</b></td>
  <td width="80"><b>telefoon nr.</b></td>
  <td><b>pieper nr.</b></td>
</tr>
<tr>
  <td></td><td>Supervisor :</td>
  <td width="200"><%= rs("superv_naam") %></td>
  <td><%= rs("superv_tel") %></td>
  <td><%= rs("superv_piep") %></td>
</tr>
<tr>
  <td></td>
  <td>Achterwacht :</td>
  <td><%= rs("achterw_naam") %></td>
  <td><%= rs("achterw_tel") %></td>
  <td><%= rs("achterw_piep") %></td>
</tr>
<tr>
  <td></td>
  <td>Regie. :</td>
  <td><%= rs("regie_naam") %></td>
  <td><%= rs("regie_tel") %></td>
  <td><%= rs("regie_piep") %></td>
</tr>
<tr>
  <td></td>
  <td>Verpl. :</td>
  <td><%= rs("eersteverpl_naam") %></td>
  <td><%= rs("eersteverpl_tel") %></td>
  <td><%= rs("eersteverpl_piep") %></td>
</tr>
<tr>
  <td></td>
  <td>Verpl. :</td>
  <td><%= rs("tweedeverpl_naam") %></td>
  <td><%= rs("tweedeverpl_tel") %></td>
  <td><%= rs("tweedeverpl_piep") %></td>
</tr>
<tr>
  <td colspan="5"></td>
</tr>
<tr>
  <td rowspan="16" valign=topn >Wachtkamer: </td>
  <td rowspan="16"><textarea name="wachtkamer" cols="120" rows="16" class="classtxtarea"><%= response.write (wachtkamer) %></textarea></td>
  <td colspan="5"><b><i>Spoed sectio</i></b></td>
</tr>
<tr>
  <td width="40"></td>
  <td colspan="2"><b>functie</b></td>
  <td width="200"><b>1e tel. nr.</b></td>
  <td><b>2e tel. nr.</b></td>
  <td></td>
</tr>
<tr>
  <td></td>
  <td colspan="2">OK Anesthesist :</td>
  <td width="200"><%= rs("OK_anesth_tel1") %></td>
  <td><%= rs("OK_anesth_tel2") %></td>
</tr>
<tr>
  <td width="40"></td>
  <td colspan="2"></td>
  <td width="200"><b>tel. dag</b></td>
  <td><b>tel. nacht</b></td>
</tr>
<tr>
  <td></td>
  <td colspan="2">OK Verpleegk. :</td>
  <td width="200"><%= rs("OK_verpl_teldag") %></td>
  <td><%= rs("OK_verpl_telnacht") %></td>
</tr>
<tr>
  <td width="40"></td>
  <td colspan="2"></td>
  <td width="200"><b>tel. dag</b></td>
  <td><b>tel. nacht/weekend</b></td>
  <td></td>
</tr>
<tr>
  <td></td>
  <td colspan="2">Kinderarts :</td>
  <td width="200"><%= rs("kinderarts_dag") %></td>
  <td><%= rs("kinderarts_nacht_weekend") %></td>
</tr>
<tr>
  <td></td>
  <td colspan="2">Spoedbloed bestellen :</td>
  <td colspan="2" width="200"><%= rs("spoedbloed") %></td>
</tr>
<tr>
  <td></td>
  <td colspan="2">Reanimatiesein :</td>
  <td colspan="2" width="200"><%= rs("reanimatiesein") %></td>
</tr>
<tr>
  <td rowspan="16" valign=topn >Te verwachten patienten: </td>
  <td rowspan="16"><textarea name="patienten" cols="120" rows="16" class="classtxtarea"><%= response.write (patienten) %></textarea></td>
  <td valign="top" align="center" colspan="5"><INPUT id="subbut" name="subbut" type="submit" value="Nummers wijzigen"></td>
</tr>
</table>
</form>
</body>
</html>

Open in new window

0
 
LVL 1

Author Closing Comment

by:Steynsk
ID: 36709591
Thanks
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question