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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a new subframe containing the form 1

Status
Not open for further replies.

amorous

Programmer
Sep 5, 2003
1,008
US
Hi Guys...

I have an ASP page(a dummy one) that looks like below:

***************************
Information about an item you selected..

Item #:XXXXXX
Item Name: XXXXX

Here are your options:

1.Update the information for this item
2.Delete this item

these above two are links

********************************

Now my question is-- When the user click on the link 1(update)...How can i open a form (may be a new sub frame) below the link on the same page..

the reason is i want the user to see the present information which is available on top of the page while updating or deleting the information??

Any Suggestions.....

-VJ
 
I frequently do this sort of things with JSPs. I have a page with a drop-down and two IFRAMES. I make the id of one IFRAME 'DATA_FRAME' and the other 'ACTION_FRAME'. ACTION_FRAME is sized with width='0%' and with src='Something.html'.

'Something.html' contains a form and hidden input elements. The action for the form is, for example, 'doSomething.jsp'.

So, in the overall parent, there is this drop-down list. Using the onchange event of the SELECT tag, I populate the ACTION_FRAME form and then submit that. the doSomething.jsp retrieves the info I want, puts it into the DATA_FRAME (which is sized to see it) before reseting itself back to Something.html.

There are other approaches, but this is basically what I do.

Code:
<head>
<script>
function reloadDataFrame()
{
 ACTION_FRAME.formName.formField.value = whatever;
 ACTION_FRAME.formName.submit();
}
</script>
</head>
<body>
<select name='dropdownList' onchange='reloadDataFrame()'>
<option value...
</select>
<iframe id='DATA_FRAME' src='display.html' width='100%' height='50%'>
</iframe>
<iframe id='ACTION_FRAME src='Something.html' width='0%'>
</iframe>
</body>

Did I say enough to make it clear what I'm talking about? Is this the kind of idea you're looking for?

--Dave
 
Yes Dave... this is what i am looking for... i will give a try to adapt this approach to my present code and will let you know how it goes...

Thanks

-VJ
 
If your item was a rubber chicken, then I would expect your code to be something very similar to below:
Code:
<script language=JavaScript>

function deleteItem() {
   //code process to delete item or redirect to another page
   alert("Item Deleted");
}

function updateItem() {
   document.getElementById("spanUpdate").style.display = "";
}


</script>
<body>
<form name=blahForm>
Item #: 123456789<br>
Item Name: Rubber Chicken<br><br>
<a href='javascript:void(updateItem())'>Update Item</a><br>
<a href='javascript:void(deleteItem())'>Delete Item</a><br><br>
<span id=spanUpdate style="display : none">
<input type=text name=itemPrice>: Price of Rubber Chicken<br>
<select name=itemColor>
<option value=#ff0000>Red Chicken
<option value=#00ff00>Green Chicken
<option value=#0000ff>Blue Chicken
</select>: Color of Rubber Chicken<br>
<select name=itemSize>
<option value=1>Big Chicken
<option value=2>REALLY Big Chicken
</select>: Size of Rubber Chicken
</span>
</form>
</body>

-kaht

banghead.gif
 
I'm just too slow today it seems........

-kaht

banghead.gif
 
Hi Kaht,

Awesome..This is what i was exactly looking for...
I will start implementing this and will let you know how it goes..

-VJ
 
Please do not cross post thread333-865089!!!!

___________________________________________________________________

onpnt.com
SELECT * FROM programmers WHERE clue > 0
(0 row(s) affected) -->faq333-3811

 
Hi Kaht...

My update function worked fine..but the delete function is not working...

this is what i tried to do...

function deleteItem(inum) {
//code process to delete item or redirect to another page
window.location="itemdeleted.asp?Itemnum="&inum
}

<a href='javascript:void(deleteItem(<%=rsitem("Itemnum")%>))'>Delete this item.</a>

Any suggestions...

-VJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top