Bug Tracker

Modify

Ticket #8793 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

javascript problem

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.5.2
Keywords: Cc:
Blocking: Blocked by:

Description

<?xml version="1.0" encoding="utf-8" ?>

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns=" http://www.w3.org/1999/xhtml"> <head>

<title>EKU</title>

<script type="text/javascript"> <![CDATA[

function valStudent() {

var lastName = document.frmStudentInfo.txtLastName.value; var firstname = document.frmStudentInfo.txtFirstName.value; var mi = document.frmStudentInfo.txtS_Mi.value; var address = document.frmStudentInfo.txtS_Add.value; var city = document.frmStudentInfo.txtS_City.value; var state = document.frmStudentInfo.txtS_State.value; var zip = document.frmStudentInfo.txtS_Zip.value; var phone = document.frmStudentInfo.txtS_Phone.value;

var dob = new Date (document.frmStudentInfo.txtS_Dob.value);

var selectAdvisor = document.frmStudentInfo.lstF_ID.selectIndex; var res = document.frmStudentInfo.chkResident.value; var stuClass; var classChecked = false;

for (var i=0; i < document.frmStudentInfo.optS_Class.length; i++)

{

if (document.frmStudentInfo.optS_Class[i].checked) {

classChecked = true; stuClass = document.frmStudentInfo.optS_Class[i].value;

} };

if (lastName == "") {

alert ("Please enter a last name"); document.frmStudentInfo.txtLastName.select(); return false;

} else if (firstname == "") {

alert ("Please enter a first name"); document.frmStudentInfo.txtFirstName.select(); return false;

}else if (address == "") {

alert ("Please enter a address"); document.frmStudentInfo.txtS_Add.select(); return false;

} else if (city == "") {

alert ("Please enter a city"); document.frmStudentInfo.txtS_City.select(); return false;

} else if (state == "") {

alert ("Please enter a state"); document.frmStudentInfo.txtS_State.select(); return false;

} else if (zip == "") {

alert ("Please enter a zip"); document.frmStudentInfo.txtS_Zip.select(); return false;

} else if (phone == "") {

alert ("Please enter a phone"); document.frmStudentInfo.txtS_Phone.select(); return false;

}else if(dob == "NaN") { alert ("Date of Birth is not valid, use MM/DD/YYYY to enter data"); document.frmStudentInfo.txtS_Dob.select();

return false;

} else {

alert ("Last name: " + lastName + "\n" + "First Name: " + firstname + "\n" +

"mi" + mi + "\n" +"Address: " + address + "\n" + "City: " + city + "\n" + "State: " + state + "\n" + "Zip: " + zip + "\n" + "phone: " + phone + "\n" +

"Date of Birth: " + dob + "\n" + "Advisor " +

document.frmStudentInfo.lstF_ID.text(selectAdvisor).text + "\n" + "classfication "

+ stuClass);

return true;

}

}

]]> </script> </head> <body> <table width="70%" align="center">

<tr> <td><img src="nwlogo.jpg" width="196" height="93" alt=" PLEASE DESCRIBE THIS IMAGE " /></td> <td> <h2>Student Information</h2> </td> </tr> </table> <form name="frmStudentInfo" action="action%20marker" id="frmStudentInfo"> <table align="center"> <tr> <td> Last Name:</td> <td><input type="text" name="txtLastName" size="20" /></td> <td></td> <td> </td> <td> <h4>Class:</h4> </td> <td></td> </tr> <tr> <td> First Name:</td> <td><input type="text" name="txtFirstName" size="20" /></td> <td> </td> <td><input type="radio" name="optS_Class" value="Freshman" /></td> <td>Freshman</td> </tr> <tr> <td> MI:</td> <td><input type="text" name="txtS_Mi" size="5" /></td> <td> </td> <td><input type="radio" name="optS_Class" value="Sophomore" /></td> <td>Sophomore</td> </tr> <tr> <td> Address:</td> <td><input type="text" name="txtS_Add" size="20" /></td> <td> </td> <td><input type="radio" name="optS_Class" value="Junior" /></td> <td>Junior</td> </tr> <tr> <td> City:</td> <td><input type="text" name="txtS_City" size="20" /></td> <td> </td> <td><input type="radio" name="optS_Class" value="Senior" /></td> <td>Senior</td> </tr> <tr> <td> State:</td> <td><input type="text" name="txtS_State" size="5" /></td> <td> </td> <td><input type="radio" name="optS_Class" value="Graduate" /></td> <td>Graduate</td> </tr> <tr> <td> ZIP Code:</td> <td><input type="text" name="txtS_Zip" size="20" /></td> <td> </td> <td></td> <td></td> </tr> <tr> <td> Phone:</td> <td><input type="text" name="txtS_Phone" size="20" /></td> <td> </td> <td>:<input name="chkResident" type="checkbox" /></td> <td> Kentucky Resident</td> </tr> <tr> <td> Date of Birth:</td> <td><input type="text" name="txtS_Dob" size="20" /></td> <td> </td> <td>Advisor</td> <td><select size="1" name="lstF_ID"> <option selected="selected">1 (Chuck Lin)</option> <option>2 (Chris Blades)</option> <option>3 (Steve Loy)</option> <option>4 (Bob Mahaney)</option> <option>5 (Ted Randles)</option> </select></td> </tr> <tr> <td></td> <td><input type="submit" value="Submit" onclick="valStudent()" /></td> </tr> </table> </form> </body> </html>

Change History

comment:1 Changed 2 years ago by rwaldron

  • Owner set to anonymous
  • Status changed from new to pending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!

Additionally, test against the jQuery 0 GIT version to ensure the issue still exists.

comment:2 Changed 2 years ago by addyosmani

  • Status changed from pending to closed
  • Resolution set to invalid

Thanks for submitting a ticket to the jQuery Bug Tracker. Unfortunately, it doesn't appear that your code includes any form of jQuery, just vanilla JavaScript. This tracker is for jQuery core issues only. For assistance with JavaScript specific issues, I recommend posting a question regarding your code on StackOverflow as they may be able to assist further.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.