getElementById Sound Simple enough!
This is my first post on this site and it will not be the last I can tell you, I am going mad here as I know I have made this issue that I have working the past but for the life of me I cannot find the page with the code on.
The issue is:
I have a form field called productColour it has an id of productColour1 I am trying to reference the value of that field when the user clicks on an images button like so:
<input type="text" name="productColour" id="productColour1">
<input type="button" name="imagePopUp" value="Images" onClick="window.open('/admin/imageControl/index.cfm?productColour=document.getElementById("productColour1").value;');">
I have tried everything I can think of and now I am off to find a brick wall to smash my head on to.
I hope that someone more knowledgeable than me could shed some light problem.
A referential value is not a string.
Wouldn't be better to call a function, instead?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<input type="text" id="productColour1" value="boo">
<input type="button" name="imagePopUp" value="Images" onclick="openWin('productColour1')">
Last edited by Kor; 02-28-2011 at
Like your thinking!
this is the query sting displayed on the called page, I have tried this on the page and with a new document.
Yes it's works
thankyou you for your help, it's people like yourself that make the world a better place.
I have lost a whole day on this myself now I can get back on tracks
I have been playing with the code you kindly sent over and I have been adding more functionality to it I do have one issue that I cannot work out and hoped you may know what to do. Can I add attributes like height and width of the opened window as you do in a normal window.open().
Originally Posted by
But it would be somehow unpleasant for the user. Most of the people use TABS now within the same browser. Modifying the window's size will modify the whole browser. Well, you can try
Sorry Kor I am not with you:
This is the final code the works fine:
What i wish to do is set the width and height on the window that will be opened e.g.
how can I enter the width and height info in the window.open (1) code.
Sorry If I am being think.
ah, sorry, I must have misunderstood your question
Do you want to add dynamically the values?
I want manually add the height and width attributes to the open window script
Where in the above code can I manually put these variables
Users Browsing this Thread
There are currently 1 users browsing this thread.
(0 members and 1 guests)
Tags for this Thread