ag3nt42 Posted July 18, 2008 Share Posted July 18, 2008 i keep getting an extra phone! alert for my validation on my form.. here is the snippet: (object being passed is 'All'): <script type='text/javascript'> function checkName(object) { if(object=='Name') { if(document.getElementById('urname').value=='') { alert('You must enter a name!'); document.getElementById('urname').focus(); } } if(object=='Organization') { if(document.getElementById('organization').value=='') { alert('You must enter an organization name!'); document.getElementById('organization').focus(); } } if(object=='Phone') { if(document.getElementById('phone').value=='') { alert('You must enter a phone number!') document.getElementById('phone').focus(); } } if(object=='All') { if(document.getElementById('phone').value=='') { if(phonez=='Focused' || orgaz=='Focused' || namez=='Focused') { alert('You must enter a phone number!'); } else { alert('You must enter a phone number!'); document.getElementById('phone').focus(); var phonez='Focused'; } } if(document.getElementById('organization').value=='') { if(phonez=='Focused' || orgaz=='Focused' || namez=='Focused') { alert('You must enter an organization name!'); } else { alert('You must enter an organization name!'); document.getElementById('organization').focus(); var orgaz='Focused'; } } if(document.getElementById('urname').value=='') { if(orgaz=='Focused' || phonez=='Focused' || namez=='Focused' ) { alert('You must enter your name!'); } else { alert('You must enter your name!'); document.getElementById('urname').focus(); var namez='Focused'; } } } } </script> i appreciate all responses. thanks, ag3nt42 Link to comment https://forums.phpfreaks.com/topic/115491-solved-extra-alert-cant-figure-out-why/ Share on other sites More sharing options...
ag3nt42 Posted July 18, 2008 Author Share Posted July 18, 2008 good job ag3nt42,, kudos to you man.. your frikin awesome.. (ps I don't say that to just anyone) ahahahahaha Link to comment https://forums.phpfreaks.com/topic/115491-solved-extra-alert-cant-figure-out-why/#findComment-593775 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.