• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

save a form after adding options to it...

 
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


ok while im in that page it shows the updated <select> but when i refresh,
all the new variants go away. I want them to stay.

do i need to update the multiple size = "n" ? or what?

like say:

document.forms['form1'].multi.multiple = /* the current value of multiple */ + 1;

Thanks,

Justin
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is impossible for the values added by JavaScript to stay. When you refresh the page it is like walking up to the blackboard and erasing everything to start over again. All the JavaScript variables are reset on the page and the page goes back to its default state.

Only thing you have to work with is storing the values in a cookie and loading them when the page loads again.

Eric
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so there's no way to permanantly update a drop down menu? not even with php or something?

Justin
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
php, JSP and other server-side mechanisms are a different thing. If you can communicate the changes and persist them back to the server, you can re-create the options on the server before sending the page to the browser.
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"re-creating" option would require you to "write" to the html document permenantly.

i know it doesnt work, but why cant i do the following?



left the '<' and '>' out cause it was giving me error when i went
to submit the post.

and if i can use cookies (ive seen simple examples) but how would i save
a form in one?

Thanks,

Justin
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just wanted to post that I figured out how to save and re-load the data using cookies.

the problem was, I wasn't capitalizing the word Option in :



boy was that a dumb mistake lol.


Justin Fox
 
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic