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

Data Validation

Status
Not open for further replies.

DAVETIGHE

Programmer
May 4, 2010
2
IE
Hi,

Completely new to Javascript and have a complete newbie question, looking at developing a Google maps webpage and used the link below to develop a page that reads map locations from a Google spreadsheet.


Have added another column to the spreadsheet and a couple of lines of code. Want to get the code to check if the string is blank before outputting the details but cannot achieve this. Any suggestions on how to amend the code below to achieve this

for (var i = 0; i < json.feed.entry.length; i++) {
var entry = json.feed.entry;

............ other code .........
?????? What do I change here?????????

if(entry["gsx$" + param_OpenHoursColumn]) {
html += "<br/> <b> Opening Hours </b>" + entry["gsx$"+param_OpenHoursColumn].$t;
}


Thanks very much.
 
Assuming you want to check the entry variable:
Code:
if((entry=="") || (entry==null)){
alert("The Variable is empty or Null");
}

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hi vacunita,

Thanks for the reply, it's actaully the column param_OpenHoursColumn in the entry JSON i was looking to test. Found the answer from your answer, I was using VB comaprsion operators instead of javascript ones.

if(entry["gsx$"+param_OpenHoursColumn].$t != "") {
html += "<br/> <b> Opening Hours </b>" + entry["gsx$"+param_OpenHoursColumn].$t;
}

Thanks again,
Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top