WoW Gold - Manga - Sxsy Lady Celebrity Fashion - Italian Property - Just Holden Commodores

PDA

View Full Version : Javascript Variable


dean5000v
Apr 15th 2009, 7:14 am
Hey well i have this code to get the correct position:

$(document).ready(function(){

var relativePosition = getRelativePosition("#Company_Name");

var Test = (relativePosition);
}



but now i want to pass these values into a hidden field so i can then pass the values to php how would i go about storing the test var value into a field.

jqueryHowto
Apr 15th 2009, 8:22 am
Something like this:

getElementById("yourHiddenElementId").value="somevalue";

dean5000v
Apr 15th 2009, 8:28 am
$("#x").val(Tests); is what i used !

jqueryHowto
Apr 16th 2009, 4:28 am
$("#x").val(Tests); is what i used !
What is "Tests". Is a variable with string in it ?!

If you are literally want to put string "Tests" into an element with ID x then you should add quotes around "Tests" like this:

$("#x").val("Tests");