Apparently you can't have an element with an id of submit in a form and call form.submit()
It will try calling that element as a function rather than invoking the form.submit method
Wednesday, April 01, 2009
Troubles calling form.submit()
Posted by Emergence at 12:14 PM 0 comments
Labels: javascript , paul
Thursday, December 27, 2007
Get text of select box
Posted by Emergence at 1:10 PM 0 comments
Labels: javascript
javascript for disabling links
<style>
a.disabled {cursor: default;color: #ccc;text-decoration: none;}
</style>
<script type="text/javascript">
var linkids=["href800 Series1","href1000 Series4","href1200 Series8"]
function activLink(b){
for (var i=0; i<linkids.length; i++){
document.getElementById(linkids[i]).onclick=function(){return b}
document.getElementById(linkids[i]).disabled=!b
}
}
window.onload = function() {
activLink(false);
}
function activLink(b){
for (var i=0; i<linkids.length; i++){
var thisLink = document.getElementById(linkids[i]);
thisLink.onclick = function() { return b }
thisLink.className = (b == true) ? '' : 'disabled';
}
}
</script>
This javascript will disable links with the ids in the list
Posted by Emergence at 1:08 PM 0 comments
Labels: javascript
Thursday, July 19, 2007
JavaScript Validation Thing
Just a little validation JavaScript function in case anyone else needs it. yes it was for some coldfusion, but no you I am not going to make it more generalized. function ValidateDate(theDate)
{
EnteredDate = new Date(theDate).toDateString();
EffDate = new Date("#DateFormat(getARD.IPI_EffectiveDate,'mm/dd/yyyy')#"). toDateString(); PrevDate = new Date("#DateFormat(DateAdd('yyyy',-1,getArd.IPI_EffectiveDate), 'mm/dd/yyyy')#").toDateString();
if(Date.parse(EnteredDate) < Date.parse (EffDate) && Date.parse(EnteredDate) > Date.parse(PrevDate))
{
return true;
}else{
alert('Date must be less than the effective date of the policy and no more than a year before the effective date.');
$('Anniversary_Rating_Date').value = '';
}
}
Posted by Emergence at 6:19 PM 1 comments
Labels: code , javascript