Forum Moderators: open
For instance this simple chunck of code will work fine, returning [ object ] in the msg box.
<INPUT
class=AppinputTextEditable id=txtJury
style="WIDTH: 30px" tabIndex=12 type=text maxLength=2 value=0 name=txtJury onchange="alert(this)" >
This will work fine, returning the value set in a message box.
<INPUT
class=AppinputTextEditable id=txtJury
style="WIDTH: 30px" tabIndex=12 type=text maxLength=2 value=0 name=txtJury onchange="alert(this.value);">
However with this chunch of code I get a runtime error, object expected.
<INPUT class=AppinputTextEditable id=txtJury style="WIDTH: 30px" tabIndex=12 type=text maxLength=2 value=0 name=txtJury onchange="calcDaysOff(this);" >
<Script>
function CalcDaysOff(obj){if (/([\D])+)¦^/x.test(obj.value)){
document.activeElement.setAttribute("value",0);
}</script>
I'm also having similar parameter passing issues... Please advise.
I'm getting an error from the regExp in the condition:
[red]expected '/'[/red] With next to nil reg exp knowledge, I can't sort that out.
However, your 'object expected' error probably comes from this:
[blue]onchange="calcDaysOff(this);"[/blue] [blue]function CalcDaysOff[/blue] ...the capitalization being the thing.