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

Validation prob for luciddream

Status
Not open for further replies.

rmz8

Programmer
Aug 24, 2000
210
US
Hey lucid, I tried e-mailing you, but the e-mail bounced. Anyway, you initially helped to create this code, so I figured that you would be the best to come to in this time of trouble. I have been trying for weeks to get this code to function in Netscape 4.7 and 6, but the code just gets overriden and there are no errors.
Code:
function validation_function() {
    if(document.frm.Resource_Type.value=='xyz') {
        alert('Please select a resource type.')
        return false;
        }
    if(document.frm.Subject_Area.value=='xyz') {
        alert('Please select a subject area for your resource.')
        return false;
        }
    if(document.frm.Grade_Level.value=='xyz') {
        alert('Please select a grade level for your resource.')
        return false;
        }
}
It is called like this:
Code:
<INPUT TYPE=&quot;submit&quot; VALUE=&quot;Submit&quot; onclick=&quot;return validation_function();&quot;>

Your help is greatly appreciated.


Ryan ;-]
 
I don't really know what your problems are but you probably need to make the following changes:

function validation_function() {
if(document.frm.Resource_Type.value=='xyz') {
alert('Please select a resource type.');
return false;
}
if(document.frm.Subject_Area.value=='xyz') {
alert('Please select a subject area for your resource.');
return false;
}
if(document.frm.Grade_Level.value=='xyz') {
alert('Please select a grade level for your resource.');
return false;
}
return true;
}

Also, I'm not sure about the whole case-sensitivity issue so you might want to try the following:

<INPUT TYPE=&quot;submit&quot; VALUE=&quot;Submit&quot; onClick=&quot;return validation_function();&quot;>
Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top