Solved

submit onblur does not work

Posted on 2011-09-27
4
288 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 Blog Template 2 34
ngStyle with an input variable doesn't work 14 30
how would you interpret lines 3 29
Recordset containing single quotes 8 21
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

912 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now