JAVASCRIPT question
- Started
- Last post
- 8 Responses
- n8w
Can someone help me with this syntax?
I basically want to create a function to auto fill some info in a form
but I want to pass 3 variables dynamically .. I can't seem to figure out how to write this part correctly?document.+myform+.+myfield+.valu...
function auto_insert(myform,myfield,myvar...
if(document.+myform+.+myfield+.v...
document.+myform+.+myfield+.valu...
}else{
document.+myform+.+myfield+.valu... ,"+ myvar;}
}Thanks!!!!!!
- orrinward0
Do a pastebin or jsfiddle link as QBN cuts code off.
I probably won't be able to help, but that will make it easier for others.
- oktalk0
Here it is really quick in jQuery and raw JS:
http://jsfiddle.net/pKb8j/Is that what you were looking for?
- jadrian_uk0
document.+myform+.+myfield
you dont need that, just do:
document.myform.myfield
and better do it with jQuery.
- mekk0
your if-statement is wrong, that statement requires something like:
if (variableXXX < variableYYY) {
do this
}
else {
do this shit
}== means is equal
=! means is NOT equal
&& means AND
&| means AND OR
|| means OR
< means smaller than
> means.. now what? ;)
- dbloc0
does anyone a good way to select a nav item with jquery and set the others back to what they were with hovers?
- dbloc0
using this to set the color
$('#pLink2').css("color","#0055A...- I'd use classes: http://api.jquery.co…
as it's less code.spot13 - can't get addClass to workdbloc
- Use a past bin or fiddle.oktalk
- I'd use classes: http://api.jquery.co…
- dbloc0
not trying to hijack the thread by the way...just looked like a logical place to ask.
- dbloc0
Got It! Thanks for making me look into that Spot.