0

I have a drop down menu that includes simple words such as; "cars, toys,food" etc. and every word has its own .properties file

cars has cars.properties
toys has toys.properties
food has food.properties
etc...

So I want to know how I can change this;

When I chose "cars" in the dropdown I want my cars.properties file to change in simplewords.properties When I chose "toys" in the dropdown I want my toys.properties file to change in simplewords.properties When I chose "food" in the dropdown I want my food.properties file to change in simplewords.properties

Is this possible?

N69S
  • 16,110
  • 3
  • 22
  • 36
phpscrub
  • 25
  • 6
  • using an ajax call, i'm guessing you want to change the file on the server. but why use that solution ? – N69S Mar 10 '20 at 10:03
  • @N69S Yes, its on the server but can you provide more detail on how I can do it with an AJAX call? I have never worked with AJAX – phpscrub Mar 10 '20 at 10:04
  • First, why do you need to change the file name instead of call the right file when the option changes ? Can you provide some code related to this restriction ? (suggestion, remove the 2€ offer, that's kinda lame) – N69S Mar 10 '20 at 10:05
  • Because my own .jar file only reads the property of out simplewords.properties and the name is unchangeable – phpscrub Mar 10 '20 at 10:07
  • can't you send the filename as a parameter ? https://stackoverflow.com/questions/456636/how-do-i-pass-parameters-to-a-jar-file-at-the-time-of-execution – N69S Mar 10 '20 at 10:09
  • 3
    This is not a place to offer that kind of financial reward for an answer to your question - removed. You can go to https://stackoverflow.com/jobs if you want to make a full-fledged job offer out of anything (probably not appropriate for a thing like this); otherwise, you just have to “reward” people for giving a successful answer by _accepting_ or upvoting answers, once they arrive. (Users with more reputation can also offer part of theirs as a _bounty_.) But any kind of financial incentives do not belong into questions here. – CBroe Mar 10 '20 at 10:10
  • @CBroe Didnt know that. Thanks for warning – phpscrub Mar 10 '20 at 10:11
  • _“only reads the property of out simplewords.properties and the name is unchangeable”_ - then you might have to _make_ it changeable. You could of course try and _rename_ files on your server, based on the selection in your form - but that would affect _all_ users at the same time, so that would have quite a lot of conflict potential when you got more than one user on your site. – CBroe Mar 10 '20 at 10:13
  • No it will not be changeable, sorry – phpscrub Mar 10 '20 at 10:14
  • Well I guess then you can really only try and rename the files (or work with a constantly updated symlink maybe) based on what the user chooses in your form, but as I said, that likely has potential for conflict, when multiple users are using this part of your site at the same time. – CBroe Mar 10 '20 at 10:34

0 Answers0