473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

get span html in javascript

232 100+
Expand|Select|Wrap|Line Numbers
  1. <span id="STATUSCNAME"></span>
javascript
Expand|Select|Wrap|Line Numbers
  1. if((editableObj.value=="" || editableObj.value.length>32 || regexname.test(editableObj.value)==false))
  2.     {$("#STATUSCNAME").html('<font color="red">*Required alphabets upto 32 characters!</font>');}
  3.     else{$("#STATUSCNAME").html('');}
  4.     }
both working but on submit i want to check validation that all span should be blank.the same is not retrieving the result

Expand|Select|Wrap|Line Numbers
  1. var spantxt=$('#STATUSCNAME').text();
  2. alert (spantxt);
alert is blank here while it should not be blank
please guide
Apr 11 '17 #1
2 1525
Dormilich
8,658 Expert Mod 8TB
Why should it not be blank?

you should post a link to your page, as there is not enough information here to solve this problem.
Apr 11 '17 #2
kkshansid
232 100+
Expand|Select|Wrap|Line Numbers
  1.     $.ajax({
  2.                 url: "chksub.php",
  3.                 type: "POST",
  4.                 data:'vchksub='+editableObj.value,
  5.                 success: function(text){
  6.                  msg=text;
  7.                  if(msg=='NO' && $("#STATUS"+vid).html()=='' && editableObj.value!="")
  8.                  {$("#STATUS"+vid).html('<font color="red">*xx!</font>');}}
  9.  
  10.                 });    
results *xx! on span text
Expand|Select|Wrap|Line Numbers
  1. <TD>SUBJECT1:</TD><TD><input type="text" onBlur="validatehu(this)" name="SUB1" id="SUB1" value="<?php echo $SUB1;?>"><span id="STATUSSUB1"></span></TD></TR>
but on final submit while checking all span text
but becomes blank on
Expand|Select|Wrap|Line Numbers
  1. var valid=$( "#STATUSSUB1" ).text()
while undefined on
Expand|Select|Wrap|Line Numbers
  1. var valid=document.getElementById("STATUSSUB2").text;
  2. alert(valid);
  3.  
irrespective of span text is blank or *xx!
this happens on background check with other table only while all others are working fine
Apr 16 '17 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Shlomi Schwartz | last post by:
Hi guys, Here is the case: <a href> inside an <IFRAME> dose not fire the event ondrop when saved as HTA Allow me to explain: I have a link inside an Iframe and I want to catch the ondrop
9
by: Robby Bankston | last post by:
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with...
21
by: strutsng | last post by:
<input type="file"> only allows the user to browse for files. How about "browse for folder" dialog? Can html/javascript do that? I couldn't find any syntax for that. If not, please advise what...
2
by: Abraham Andres Luna | last post by:
hello everyone, is there a method in .net that will format: MIKE O'CON"NEL\ to: MIKE O''CON&quot;NEL\\
9
by: outstretchedarm | last post by:
How exactly does HTML/Javascript handle playing midi files? Does it have a player imbedded in it? Or does it borrow from the computer's midi player? How could you make a webpage play certain...
5
by: fjanon | last post by:
Is there a way to remove the default footer/header from the printed page when printing a page from HTML/Javascript in IE 6? I want to use letterhead paper and I have to remove manually the...
12
by: John | last post by:
I have to write a spyder for a webpage that uses html + javascript. I had it written using mechanize but the authors of the webpage now use a lot of javascript. Mechanize can no longer do the job....
9
by: ajos | last post by:
hi all, im getting some problems in my javascript validations..... my jsp code--> 8: <head> 9: <title>Budget Master Administration</title> 10: <meta name="GENERATOR" content="Microsoft...
6
by: kiranbabu | last post by:
how to rotate an image using html/javascript
1
by: lakhanmahajan | last post by:
<html> <head> <script type="text/javaScript"> function setAlignment(){ var p1 = document.getElementById('2'); p1.style.topMargin = 20; return true; } </script>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.