07-29-2012, 06:46 PM
Not sure what is the level of this question, but any help would be much appreciated.
p = imgsrc;
I'm displaying variable return from display() function in HTML (as shown below)
Whenever Link is clicked, I want 'p' variable to be updated.
Thanks in advance!!!!!!!
07-29-2012, 09:47 PM
Two questions here,
One, Why can you not have the p variable in the second function?
Two, you haven't actually referenced either of the functions in the onclick
07-30-2012, 09:31 PM
Thanks four your response.
For your first question, I dont want to pass p variable in display() function coz in that case return value will be same as input. I want to use display() function only for returning 'p' value purpose which will be passed in a() function.
So basically I want to use value passed in a() function to be used as variable which will be returned from display() function.
For your second question, I dont understand about referencing. Is it necessary to reference your function. I guess I'm calling a() function through OnClick. And display() function is only being used to return a value which is fianlly displayed on the webpage.
Can you please correct me if I'm wrong. Thanks!!
07-30-2012, 10:20 PM
Please use the forum's bbcode tags to make it more readable:
for php code............
<?php /* code goes here */ ?>
<!-- markup goes here -->.....
code goes here................
07-30-2012, 10:45 PM
var p = imgsrc;
07-30-2012, 11:16 PM
Hey I like this approach. Also it will solve my problem as we are not passing anything through display() function and desired value gets printed out by directly calling display().
This code is not working for me. Was it working for you?
I tried it in a different way though. I called the function display() directly rather than calling it through onClick. But its not working.
07-31-2012, 12:11 AM
Bernie's code won't work because your trying to call function display before you've called function a (the p variable is never set).
Also, you said that when you click on the link, you want the p variable to be updated... his above script doesn't do that...
This script should do what your asking..... maybe :D
p = imgsrc;
07-31-2012, 01:09 AM
Ah, that looks about right, so your calling the actuall display function when you're initializing the variable.
07-31-2012, 11:12 PM
Thanks a lot everyone!!!!
Its working now.
U guys ROCK!!!!!!
08-01-2012, 12:49 AM
One more thing -
If this thread is finished, please set it to resolved.
You can do this by editing the first post within the thread - Pressing go advanced - Then where it says no prefix, selecting resolved then save.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.