javascript and form elements...
akeem | Posted 3:58am 9. April 2003 Server Time |
Hey..
Does anyone here know how to get the value ina text input field from another window, in jacascript?
I use document.formname.elementname.value; when it's in the same window, but how can I access a different window?
anyone?
|
Agent7even | Posted 4:25am 9. April 2003 Server Time |
ok well what exactly are you doing? Are you having a page pop up a window , then in the new window selecting somstuff then on closeing that window sending the data back to the parent page?
-AGeNt7eVeN
akeem | Posted 4:27am 9. April 2003 Server Time |
I'm opening a popup window, and I need to send or recieve values from a form in the parent window...
Agent7even | Posted 4:47am 9. April 2003 Server Time |
ok sorry still a bit vague.
You have a text box called textbox1 and a link next to it sayin search.
when the user clicks search a pop up opens.
inside the pop up u use asp to fill a textbox2 with data.
then when the user clicks close the data in textbox2 is passed back to textbox1
yea?
-AGeNt7eVeN
akeem | Posted 5:29am 9. April 2003 Server Time |
Sorry :)
1. Open a popup window.
2. Use javascript in the popup to request a value from a form element in the parent window.
Parent window:
<form id="form1">
<input type="hidden" id="hiddenvalue" name="hiddenvalue" value="value">
</form>
Popup:
<script language="javascript">
var formvalue=I need the value from hiddenvalue in form1 here
</script>
I know that I could pass the value to the popup window when opening it, but I need to be able to get the value whenever I want in the popup window... Don't ask why .. too much to explain :)
akeem | Posted 7:05am 9. April 2003 Server Time |
anyone?
will this work?
windowname.document.form1.hiddenvalue.value
akeem | Posted 7:38am 9. April 2003 Server Time |
problem is that I don't have a name for the parent window..
David Steven | Posted 10:52am 19. August 2004 Server Time |
Did anyone ever figure out how to do this?
Using an onmouseover event I would like to launch a popup containing a table of values and pass the selected value back to the form field just like a date picker.
Regards
david
probinu | Posted 10:57am 19. August 2004 Server Time |
I am confused, I think that this is fairly easy, you can use javascript to populate a form (that can be hidden) and then pass the from results to an asp page and capture the data. If this is what you need I can give you the code, if not, please explain further.
David Steven | Posted 11:41am 19. August 2004 Server Time |
Hi probinu,
I might well be making this more difficult than it is. I have a page (asp.form) that displays data from a database. There is one field to be completed and then it is resubmitted to the database to be archived.
I just want the user to be able to select the value for this field from a popup window (popup.html). I could have the popup submit directly to the database but would prefer the value to be inserted into the text field on the form. Can't figure out how I get the value from the popup into the form field?
Don't know if that clarifies or not.
Thanks for looking at it.
david
probinu | Posted 1:39pm 19. August 2004 Server Time |
I can help you with this, but first I have a question. Does it have to be a text field or can it be a list or drop down menu? I think you could save time, if not I will code it for you the other way.
David Steven | Posted 11:33am 20. August 2004 Server Time |
Hi probinu,
This is a form that displays a Risk Assessment Report pulling data from a database. Someone then has to grade the risk using Risk Matrix displayed in a table. I had considered at drop down but it would not have as much visual impact as a color coded table.
I wondered if an alternative approach to trying to pass the value from the popup to the page might be to use a dynamic tooltip to in effect copy the value from one form to another.
I think that I could use a dual appraoch of a popup to display the Matrix and a dhtml drop down menu with color coded child menus from which to make the actual selection.
David
superpc | Posted 8:57pm 22. August 2004 Server Time |
in the parent window, paste this code:
function returnValue(sValue) {
document.thisParentForm.txtName.value= sValue;
}
in the popup window;
eg. after u key in or select a value to teh textbox(txtThisValue), click on a button, let say, Ok button
so when u click teh ok button call this:
function submitValue(){
window.opener.returnValue(document.thisChildForm.txtThisValue);
window.close();
}
replace the thisParentForm and thisChildForm by your own form name.
yashveer | Posted 8:08am 11. September 2007 Server Time |
Hi
I am a beginner and a need a little bit of help if u can please .
I want a solution for the problem as u understood.
I am reproducing the same as u described
ok sorry still a bit vague.
You have a text box called textbox1 and a link next to it sayin search.
when the user clicks search a pop up opens.
inside the pop up u use asp to fill a textbox2 with data.
then when the user clicks close the data in textbox2 is passed back to textbox1
yea?
Please guide me 4 that .
Thanking u in advance
Yashveer
Reply to Post javascript and form elements...
|
|
|