hi all
i have two windows open. one has a form on it with prepoluated <input type='text'...> tags. each input tag has a unique name.
the second window has a form on it, that once submitted, needs to update some of the values of the 1st prepopulated form to reflect the changes.
how would i achieve this wihtout having to refresh the first form's page?
please note that the 2nd form/page is opened via a link on the first form/page.
thanks
howto? submitting one form updates values in another (no f5)
Moderator: General Moderators
-
konstandinos
- Forum Commoner
- Posts: 68
- Joined: Wed Oct 04, 2006 4:20 am
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Depending on how the second window was created, Javascript can communicate to it, or you could have Ajax incorporated that will refresh the information as needed. .. However if Javascript is disabled (or limited in some fashion) it would be a good idea to remind the user they may need to refresh the second window if it didn't update.
Using the DHTML color ramp method of bring the update to the user's attention can help a lot in getting their attention that it changed (if they can see the page.)
Is there a reason this requires two windows?
Using the DHTML color ramp method of bring the update to the user's attention can help a lot in getting their attention that it changed (if they can see the page.)
Is there a reason this requires two windows?
-
konstandinos
- Forum Commoner
- Posts: 68
- Joined: Wed Oct 04, 2006 4:20 am
i think the reason is justified.
one of the input tags (the one in question) on the first page contains an image url, which is readonly. next to that is a link to the 2nd page/form (the image manager, which ill get to just now). below this is the actuall image on display for the user.
clicking on the image manager opens the 2nd page, which has the option to upload a new image, and below that is a small thumbnail gallery of each image already uploaded. the user can scroll through this gallery, and select an image. (uploading an image updates the gallery). once the user has chosen an image, and clicked on submit, the page must close, and in turn update the image url and the image on display on the first page.
i could force refresh, but this might be troublesome if the user has already edited some of the input fields further up without saving them.
thus i am a bit stuck.
if you can suggest a way to solve this, even if its a completely different approach, i would be most grateful.
one of the input tags (the one in question) on the first page contains an image url, which is readonly. next to that is a link to the 2nd page/form (the image manager, which ill get to just now). below this is the actuall image on display for the user.
clicking on the image manager opens the 2nd page, which has the option to upload a new image, and below that is a small thumbnail gallery of each image already uploaded. the user can scroll through this gallery, and select an image. (uploading an image updates the gallery). once the user has chosen an image, and clicked on submit, the page must close, and in turn update the image url and the image on display on the first page.
i could force refresh, but this might be troublesome if the user has already edited some of the input fields further up without saving them.
thus i am a bit stuck.
if you can suggest a way to solve this, even if its a completely different approach, i would be most grateful.
-
konstandinos
- Forum Commoner
- Posts: 68
- Joined: Wed Oct 04, 2006 4:20 am
oh and i have thought about just putting all the functionality of the image manager form into the first form, but the problem with that is say i have 5 or even 10 images within one row...
then it will be a case of repeating the same gallery 10 times, with the same upload file input input field etc... could get very cumbersome. i figured separating this into one nice little window (that is opened in a new window and resized to only take up the space it needs to) would be the way forward.
although part of me is kicking myself for forcing my user to run more than one window in a web-app.
then it will be a case of repeating the same gallery 10 times, with the same upload file input input field etc... could get very cumbersome. i figured separating this into one nice little window (that is opened in a new window and resized to only take up the space it needs to) would be the way forward.
although part of me is kicking myself for forcing my user to run more than one window in a web-app.
-
konstandinos
- Forum Commoner
- Posts: 68
- Joined: Wed Oct 04, 2006 4:20 am
the first form is your typical "edit a row in a db" type form.
it is dynamically generated, based on the mysql_field_type of each column, as well as some other checks from a metadata table (besides the point).
so once i choose to edit a row, the edit form pops up with input fields for the row in question. this row mightonly have one image url column, or it may have, say, 5 columns, all containing image url's (think of a row dedicated to 'house', and images for lounge, bedroom, bathroom, etc).
so the reason i want to have a separate-page form for the image manager (which allows the user to upload new photos as well as specify which photo to use for the column / input-field in question) is that, if i am in a situation where there are many columns with images (like in the house example), i dont want to have a cumbersome edit area for each image column.
i just want a simple readonly text field showing the current image url being used, a link (to the image management form) to change the image url, and on the next line the actual image on display (<img src=$row[$i] .../>)
if a row was limited to only one image column, then sure, i'd put the image management stuff (the upload image and thumbnail gallery features) all on the first form. but since i may have many image columns in one row, i thought i'd try simplify the aesthetics of the first form and put all that in a separate form.
does that make sense?
i'm going for a run now. hopefully, if i'm still confusing the socks off of you, ill have a clearer way of explaining all that once i return
it is dynamically generated, based on the mysql_field_type of each column, as well as some other checks from a metadata table (besides the point).
so once i choose to edit a row, the edit form pops up with input fields for the row in question. this row mightonly have one image url column, or it may have, say, 5 columns, all containing image url's (think of a row dedicated to 'house', and images for lounge, bedroom, bathroom, etc).
so the reason i want to have a separate-page form for the image manager (which allows the user to upload new photos as well as specify which photo to use for the column / input-field in question) is that, if i am in a situation where there are many columns with images (like in the house example), i dont want to have a cumbersome edit area for each image column.
i just want a simple readonly text field showing the current image url being used, a link (to the image management form) to change the image url, and on the next line the actual image on display (<img src=$row[$i] .../>)
if a row was limited to only one image column, then sure, i'd put the image management stuff (the upload image and thumbnail gallery features) all on the first form. but since i may have many image columns in one row, i thought i'd try simplify the aesthetics of the first form and put all that in a separate form.
does that make sense?
i'm going for a run now. hopefully, if i'm still confusing the socks off of you, ill have a clearer way of explaining all that once i return