Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

submit onblur does not work

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
Steynsk
Asked:
Steynsk
1 Solution
 
ZvonkoSystems architectCommented:
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
 
jawa29Commented:
Hi

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

Jawa29
0
 
sonawanekiranCommented:
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
 
SteynskAuthor Commented:
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now