PDA

View Full Version : help please!


j0sh
12-06-2002, 09:29 PM
Ok, i've got this issue with a script im making i'll try to explain it as best as I can.

There is a form on my page named "theform"

inside this there is in input field called "input_val" which is either a 0 or a 1

i have a link to a pop up

<a href="Javascript:openWindow('popup.php','win_name_here','resizable=yes,width=250,height=195')">

Now what i want to do is change the link from popup.php to popup.php?val=(THE VALUE OF input_val HERE)

so something like
<a href="Javascript:openWindow('popup.php?val=document.theform.input_val.value'','win_name_here','resizable=y es,width=250,height=195')">

is what i tried, but instead of it putting the value it just puts document.theform.input_val.value

any help you guys could provide would be greatly appreciated.



Thank you
Josh

j0sh
12-06-2002, 09:33 PM
my apologies if this has been asked before, im looking for the answer as well.

Thank you.

DoubleV
12-06-2002, 09:39 PM
try

<a href="Javascript:openWindow('popup.php?val='+document.theform.input_val.value,'win_name_here','resizable=y es,width=250,height=195')">

DoubleV
12-06-2002, 09:42 PM
umm,
i dunno why a space appears between 'input_val.' and 'value'. when i go to edit my post it is not there. s just make sure you remove the psace when testing

j0sh
12-06-2002, 09:49 PM
still not working, thanks though.. anyone else?

j0sh
12-06-2002, 10:41 PM
got it! thanks Double V


function the_url() {
win_url = "popup.php?pop_1="+document.theform.pop_1.value;
// Would this work for adding the other vars?
// win_url .= "&pop_2=" +document.theform.pop_2.value;
// ?? thanks


window.open(win_url, "newWin", config='height=505,width=750,menubar=yes,resizable');
}

<a href="Javascript:the_url()">

j0sh
12-06-2002, 10:47 PM
got it working with all fields, thanks alot :)

DoubleV
12-06-2002, 11:02 PM
josh,
you're very welcome! :D
after i posted the function, i thought i was completely off, so i deleted the post. good thing you saw it before i deleted. glad i could help.