/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Changing selectedItem based on query

Hi guys,
I’ve just been trying to work out how to solve this problem.

A data entry section of the webapp I’m developing is broken into three pages, each adding data to my MySQL database. The user is able to go back and forth through the pages to make adjustments as necessary and the database is updated as required.

I’m able to echo data back into textfields just fine, I’m just not sure on how to go about changing the listboxes to show the item that was selected prior to the query.
One option is to write a loop in PHP but I feel that there may be a better way of achieving this with js/ajax to change the selectedItem.

Any suggestions much appreciated.

Thanks ?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@futurxyauthorJun 03.2008 — Disregard that, I'm an idiot. Decided in the end to write an edit option, in which options are looped through before being echoed (and selected="selected" applied as needed).
×

Success!

Help @futurxy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...