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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On change function...... 1

Status
Not open for further replies.

arravalli12

Programmer
May 3, 2005
62
US
I am calling java script function on change and this works good. The problem I have is I do not want to capture changed records if the changed record has the same value as previous one.Currently say the initial record is 0 and I put 00, this record is captured and when it updates, it changes the flag to 'Y'. I do not want this to happen if record is same as before.
Any idea how to do this?

<td align="center"><input name="txtNum<%= intRecID %>" type="text" onChange="RecUpdate('<%=intRecID %>')" value="<%=trim(Recordset1.Fields.Item("FAMILY_CDE").Value)%>" size="3" maxlength="3"></td>
 
Try using parseInt().

in your RecUpdate() function, check to see whether the previous value was the same as your last. or try something like this:

Code:
// place this between <script></script> tags in the head.
var tempHolder;




<input name="txtNum<%= intRecID %>" type="text" onChange="if (parseInt(this.value) != tempHolder) RecUpdate('<%=intRecID %>');" value="<%=trim(Recordset1.Fields.Item("FAMILY_CDE").Value)%>" size="3"  maxlength="3" onfocus="tempHolder = parseInt(this.value);">

*cLFlaVA
----------------------------
[tt]your mom goes to college[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
I could not test yesterday as my server was down.Tempholder logic worked perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top