Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I open a new document in a

Status
Not open for further replies.

Riku

Programmer
Sep 2, 2001
119
How can I open a new document in a frame and input
a value to a field. Code below don't work.

top.mainFrame.location.href = "edit_field.asp";
top.mainFrame.document.form1.pollIndex.value = "sss";

It seems that href line is not changing the href untill the hole function is run. So how can I open a new document and
edit its fields using one function? F: Riku Tuominen
riku.tuominen@benchmarking.fi
 
You can do it this way :
in calling page :
Code:
top.mainFrame.location.href = "edit_field.asp?pollIndex=sss";

in called page (edit_field.asp):
Code:
<%
dim parm
parm = request.QueryString(&quot;pollIndex&quot;)
%>
<Form id=form1>
<input id=pollIndex value=&quot;<%=parm%>&quot;>
...
Water is not bad as long as it stays out human body ;-)
 
Yes that's true. I would need this problem solved rather in the function. I have a large web app with lot of code, where this needs to be resolved. I feel that the code would be too fractured if sending info through url. Also som fields might include to mutch info to be put to the URL(length ristriction).

Is there any other command style in javascript to open a doc in a frame.

or or ... F: Riku Tuominen
riku.tuominen@benchmarking.fi
 
How about something like:

var myWindow = top.mainFrame.location.href = &quot;edit_field.asp&quot;;

myWindow.mainFrame.document.form1.pollIndex.value = &quot;sss&quot;;

Maybe not directly like that but ... any one maybe get an idea. F: Riku Tuominen
riku.tuominen@benchmarking.fi
 
So can't you do it in the other way. I mean if it doesn't work to fill your value from &quot;calling frame&quot;, why don't you try to do it from &quot;called frame&quot; by setting the value of your input in an onload event with a value stored in &quot;calling frame&quot; ? Water is not bad as long as it stays out human body ;-)
 
Yes maybe that would be best solution, even though that function is splitted to two. I gues I am trying to get the code more simple than is possible?
Thank you wery mutch for your ideas, they are appreciated.
I you figure out how to do it simply in onn function, maybe not today, please hope you tell me. It would simplify my code quit a lot. I like to have procedures in on place.

Thanks again!!!
F: Riku Tuominen
riku.tuominen@benchmarking.fi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top