Click here to Skip to main content
15,891,951 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionDrag and drop database related items Pin
tinaclement9-Apr-14 3:04
tinaclement9-Apr-14 3:04 
AnswerRe: Drag and drop database related items Pin
ZurdoDev10-Apr-14 1:53
professionalZurdoDev10-Apr-14 1:53 
QuestionGet ID of Clicked Object in Iframe Using JQuery Pin
RebornProgrammer8-Apr-14 17:38
RebornProgrammer8-Apr-14 17:38 
SuggestionRe: Get ID of Clicked Object in Iframe Using JQuery Pin
ZurdoDev10-Apr-14 1:55
professionalZurdoDev10-Apr-14 1:55 
QuestionAdd a dynamic label to video selected Pin
wfzen8-Apr-14 10:29
wfzen8-Apr-14 10:29 
AnswerRe: Add a dynamic label to video selected Pin
jkirkerx9-Apr-14 9:29
professionaljkirkerx9-Apr-14 9:29 
GeneralRe: Add a dynamic label to video selected Pin
wfzen14-Apr-14 4:59
wfzen14-Apr-14 4:59 
Questionfocus() not working Pin
RabbitTrail6-Apr-14 17:27
RabbitTrail6-Apr-14 17:27 
Below is code I have been trying. Everything works except the focus. When the alert box's OK is clicked, focus is not set to the blank text/textarea control that caused the error to happen. According to articles online, this should work but it is not. Any suggestions would be greatly appreciated.

<!DOCTYPE html>
<html lang="en">
<head>
<meta "charset=utf-8" />
<title>Trying It Out</title>
<script type="text/javascript">
    function checkForm()
    {
        var str = ''; //for testing purposes later
        var e = document.getElementById('myForm').elements;
		
       //Insert for statement here//
		for(i=0; i <= e; i++){
			if(e[i].value.length <1){
				alert("The field " + e.[i].name + " is blank");
				var mytext = document.getElementById(e[i].name)
				mytext.focus();
				return false;
				
			}
		}

     }
</script>
</head>

<body>

<form id="myForm" name="myForm" action="showIt.htm">
<p>
Your Name: <br /><br />
<input type="text" name="Your_Name" value="enter your name" />
</p>
<p>
Interesting Fact About You: <br /><br />
<textarea name="Interesting_Fact">something about you</textarea>
</p>
<input type="submit" value="Submit Data" onclick="return checkForm(this.form);" />

</form>
<hr />
<div id="showTheValues"></div>
</body>
</html>

AnswerRe: focus() not working Pin
Blikkies7-Apr-14 22:01
professionalBlikkies7-Apr-14 22:01 
AnswerRe: focus() not working Pin
venkatpvc19-Apr-14 10:34
venkatpvc19-Apr-14 10:34 
AnswerRe: focus() not working Pin
Sunasara Imdadhusen7-May-14 3:39
professionalSunasara Imdadhusen7-May-14 3:39 
GeneralRe: focus() not working Pin
RabbitTrail24-May-14 3:35
RabbitTrail24-May-14 3:35 
AnswerRe: focus() not working Pin
blachsmith23-May-14 23:14
blachsmith23-May-14 23:14 
GeneralHow to Show and Hide upon button OnClick (CSS or JQuery) Pin
Member 107286056-Apr-14 11:48
Member 107286056-Apr-14 11:48 
AnswerRe: How to Show and Hide upon button OnClick (CSS or JQuery) Pin
ZurdoDev7-Apr-14 3:44
professionalZurdoDev7-Apr-14 3:44 
QuestionCan we call server side function on OnBlur in Javascript? Pin
Schatak5-Apr-14 3:25
professionalSchatak5-Apr-14 3:25 
AnswerRe: Can we call server side function on OnBlur in Javascript? Pin
ZurdoDev7-Apr-14 3:45
professionalZurdoDev7-Apr-14 3:45 
AnswerRe: Can we call server side function on OnBlur in Javascript? Pin
Anlige2-Sep-14 20:49
Anlige2-Sep-14 20:49 
QuestionWhile calling MVC webservice from my html page it was always going to error; please help me, i even used JSONP and Callback Pin
Osmosys Email3-Apr-14 19:16
Osmosys Email3-Apr-14 19:16 
Questiontree in javascript Pin
Member 911920531-Mar-14 19:35
Member 911920531-Mar-14 19:35 
SuggestionRe: tree in javascript Pin
ZurdoDev7-Apr-14 3:46
professionalZurdoDev7-Apr-14 3:46 
AnswerRe: tree in javascript Pin
Sunasara Imdadhusen21-May-14 23:41
professionalSunasara Imdadhusen21-May-14 23:41 
QuestionLoading large XML file into HTML format problem Pin
sma123#31-Mar-14 3:52
sma123#31-Mar-14 3:52 
Questionjquery,.net Pin
pkarthionline26-Mar-14 1:38
pkarthionline26-Mar-14 1:38 
AnswerRe: jquery,.net Pin
Richard MacCutchan26-Mar-14 1:42
mveRichard MacCutchan26-Mar-14 1:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.