Hi
Can somebody advise if I can / how to do something like this:
getNodeValue... ..add this to something.....t han set added value to the Node.
Basically, the CityName displays correctly (onclick update). I have a value stored in the CityTime that equals the difference in hours between GMT/UTC and the time for the city (e.g. Frankfurt = 1).
How do I add this to a UTCString to get the actual...
User Profile
Collapse
-
referencing onclick()
Hi
Im finding this so confusing & painful to learn.
My problem is with referencing onclick script correctly, do you use the HTML name=xyz or id=abc as the reference?
For example, how do I correctly reference these in my onclick script:
[HTML]
<input name="btnShowCi tyInfo" type="button" id="btnShowCity Info" value="Show City Info" onclick="showCi tyInfo()"/></td>... -
thanks both,
I read up on it as suggested and its now working. Thanks heaps.
tj - thanks for the logic behind the expression, it really helped me understand how it is working.
Cheers again -
Validating an email address
Hi
Again its probably easy, but here I am stuck on checking for these in an input.
Can it be checked like this? Do I need to look at some other validation method for this?
...Code:if(( ! document.fmOrder.cdEmail.value == 0 ) && (does not contain an @ and one . in sequence)) { errors.push("Please enter a valid email address"); } -
Thanks, that is exactly what I think I am looking for, will check it out tomorrow.
Cheers
MLeave a comment:
-
return true / return false validation
Hi
Basically, this is the last function called and checks if there were any errors, if so it returns all the errors in one alert message, if not form should proceed on submit.
So if there is an alert(msg) returned, I don't want the form to submit.
Any suggestions on how to add this would be appreciated.
[CODE=javascript]
function addMsg(){
alert(msg)
msg =... -
Cheers
Now I only get one message, however it still appears even if the last one is selected.
Do I have to ditch the loop and go for an "if / else if / else if / else" statement?
What will give the best result?Leave a comment:
-
Too many alert messages
Hi
Can anyone give advice on how to get only one alert message out of this code:
Im hoping its an easy solution but Im stuck on it & only new to JavaScript.
Many thanks
M
[CODE=html]
<html>
<head>
<title>Form</title>
<script language="JavaS cript" type="text/JavaScript">
... -
Hi
It worked (you knew it would).
Thanks again for all your help.
Cheers
MLeave a comment:
-
Hi gits
Thanks heaps for your help. Not sure I understand fully how to do it but I'll take on board what you said and have another look at it next week.
Again thanks
Vielen Dank
Bis baldLeave a comment:
-
Hi
Im now confused with the if(function(... ...) part, so here goes with another 'dumb' question (it was easier learning German that JavaScript), is the correct procedure:
Code:if(function(a,errMsg)) || (function(b,errMsg) etc...... or something like (i.e. drop error msg until end) if(function(a,( || (function(b, (|| function(c,errMsg)))))))
Leave a comment:
-
Hi
I see the wrap buttons now, thanks.
What I don't understand is the if/or part.
I understand if(myVal > 10 || myVal <100) ..... in one statement, What I don't get is something like this:
Which is correct?
I guess...Code:if(xVal > 10) || (yVal < 100) .... or if((xVal > 10) || (yVal < 100)) ....
Leave a comment:
-
Hi
Thanks, I don't quite get it but I'll read up some more and take what you've said and hopefully I'll understand it later..... (never know).
You mentioned to use CODE tags. What do you mean by this for future reference?
CheersLeave a comment:
-
Thanks for the reply's
Not sure that I understand the whole && and || in the if statements yet. This is what I think your suggesting (hope I'm right):
....
[CODE=javascript]
if(isNumeric(ho mePhone, contactMsg)) || (isNumeric(mobi le,contactMsg)) || (emailValidator (email, contactMsg)){
return = true;
}else{
return false;
}[/CODE]
Q. Can this...Leave a comment:
-
Form Validation
Hi guys
I'm having a little trouble with form validation, I can get the entire form to validate without problems (i.e. when all fields set to required & valid data is entered) but can't get it to work when some are required and others are optional (but one of the optional fields is required).
I'm hoping that its something that Im overlooking but I've tried a number of ways and can't get valid results.
...
No activity results to display
Show More
Leave a comment: