H
Haplo567
Guest
Here's the situation: We're using a DAP as a database front end. What I'm trying to do is have the user enter a phone number in text boxes, but output the result to one field. The way I'm doing this is by having a hidden text box bound to the phone number, and updating it via the onkeyup event for the three input text boxes. Here's the relevant code I'm using:
<SCRIPT language=vbscript>
<!--
Sub CompilePhone()
PhoneNumber.innerText = txtPhone1.innerText & txtPhone2.innerText & txtPhone3.innerText
End Sub
Sub UncompilePhone()
txtPhone1.innerText = left(PhoneNumber.innertext,3)
txtPhone2.innerText = mid(PhoneNumber.innertext,4,3)
txtPhone3.innerText = mid(PhoneNumber.innertext,7)
End Sub
-->
</SCRIPT>
<SCRIPT language=vbscript event=DataPageComplete(info) for=MSODSC>
<!--
call UncompilePhone()
-->
</SCRIPT>
<SCRIPT language=vbscript event=onkeyup for=txtPhone1>
<!--
Call CompilePhone()
-->
</SCRIPT>
<SCRIPT language=vbscript event=onkeyup for=txtPhone2>
<!--
Call CompilePhone()
-->
</SCRIPT>
<SCRIPT language=vbscript event=onkeyup for=txtPhone3>
<!--
Call CompilePhone()
-->
</SCRIPT>
The problem: This code works just fine, except for the fact that the data access page doesn't register that the phone number has changed when I change it via txtPhoneX. If I leave PhoneNumber unhidden and change it via txtPhoneX, I can then select PhoneNumber and enter a junk character and back space, then save it.
My question: Is there a way to force the phone number field to enter a state where it knows it needs to update?
<SCRIPT language=vbscript>
<!--
Sub CompilePhone()
PhoneNumber.innerText = txtPhone1.innerText & txtPhone2.innerText & txtPhone3.innerText
End Sub
Sub UncompilePhone()
txtPhone1.innerText = left(PhoneNumber.innertext,3)
txtPhone2.innerText = mid(PhoneNumber.innertext,4,3)
txtPhone3.innerText = mid(PhoneNumber.innertext,7)
End Sub
-->
</SCRIPT>
<SCRIPT language=vbscript event=DataPageComplete(info) for=MSODSC>
<!--
call UncompilePhone()
-->
</SCRIPT>
<SCRIPT language=vbscript event=onkeyup for=txtPhone1>
<!--
Call CompilePhone()
-->
</SCRIPT>
<SCRIPT language=vbscript event=onkeyup for=txtPhone2>
<!--
Call CompilePhone()
-->
</SCRIPT>
<SCRIPT language=vbscript event=onkeyup for=txtPhone3>
<!--
Call CompilePhone()
-->
</SCRIPT>
The problem: This code works just fine, except for the fact that the data access page doesn't register that the phone number has changed when I change it via txtPhoneX. If I leave PhoneNumber unhidden and change it via txtPhoneX, I can then select PhoneNumber and enter a junk character and back space, then save it.
My question: Is there a way to force the phone number field to enter a state where it knows it needs to update?