Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing Textbox Changes

Status
Not open for further replies.

TheDrParker

Programmer
Nov 21, 2001
55
0
0
US
I have a textbox DTC connected to a recordset that I want to make updateable. I want to be able to capture the change to use to update the recordset later.

I have tried:
<SCRIPT ID=serverEventHandlersVBS LANGUAGE=vbscript RUNAT=Server>
Sub thisPage_onenter()
DataTxtBox1.advise &quot;onblur&quot;, &quot;UpdateRec()&quot;
End Sub
</SCRIPT>

<SCRIPT LANGUAGE=vbscript RUNAT=server>
Sub UpdateRec()
thispage.setTextVal(DataTxtBox1.value)
Response.Write(&quot;Updating Rec:&quot;)
Response.Write(thispage.getTextVal())
Response.Write(&quot;<BR>&quot;)
End Sub
</SCRIPT>

<script language=javascript>
function thisPage_onbeforeserverevent(obj,evnt)
{
if (obj==&quot;DataTxtBox1&quot;)
{
if (evnt==&quot;onblur&quot;)
{
if (DataTxtBox1.value == &quot;&quot;)
{
thisPage.cancelEvent=true;
alert(&quot;No Sir.&quot;);
}
else
{
}
}
}
}
</script>

And I have tried:

<SCRIPT ID=serverEventHandlersVBS LANGUAGE=vbscript RUNAT=Server>
Sub DataTxtBox1_onchange()
thisPage.setTextVal(DataTxtBox1.value)
Session(&quot;Test1&quot;) = DataTxtBox1.value
End Sub
</SCRIPT>

In either case after OnChange or OnBlur the page calls itself and the textbox value is reset by recordset. How do I capture the value in the textbox before it is replaced by the value in the recordset when the page is called.

BTW: Session('Test') and thisPage.setTextVal() can't capture it in the onbeforeserverevent because that is client side.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top