I have these two short conflicting scripts -- help!

J

Julia Briggs

Hello, I have these two scripts, where the first one is being canceled
out by the second, they work independently, but not together (they are
a auto-tab and form box character counter script) -- hopefully one can
see how they are conflicting and fix a solution so they can work and
mesh together. It seems the second script is canceling out the first
-- so I am not sure what the problem is. Thanks for anyone's help!
:))

Sincerely,

%julia%


<script>
function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}
</script>

<script type="text/javascript">
function showRemaining(formElement) {
var theForm = formElement.form;
var remainingDisplay = formElement.name + 'Remaining';
theForm.elements[remainingDisplay].value = formElement.maxLength -
formElement.value.length;
}
</script>
 
C

Chris

Hi Julia,

Not really enough information to say for sure.
I'm guessing you're using something like an onKeyUp event on the form
element to launch both functions.
You can do this by separating the two function calls by a semicolon e.g.
onKeyUp="autotab(parm1,parm2);showRemaining(parm)".
What you can't do is have two separate onKeyUp event parameters defined in
the same tag (though event bubbling permits other ways of launching two
functions on the same event).

Hope this helps,
Regards,
Chris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top