/    Sign up×
Community /Pin to ProfileBookmark

storing user input into a variable w/ onBlur()

I’m a newb to Java, but I’m trying to incorporate a bit of it into a PHP order form I’m building. I have a “Pickup Date” input box, the value of which is needed to filter a dropdown menu I have further down the form (same page). I’ve been doing a lot of searching, and have found that the onBlur() event should work, if only I can figure out a function that will store the user-entered date into a variable I can use later. Any help, or a shove in the right direction, would be greatly appreciated.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Sep 09.2005 — FYI: Java != JavaScript

onblur="yourJSVariable=this.value";

Not sure you would use a variable since you are able to reference the form value in your script.

Eric
Copy linkTweet thisAlerts:
@Crono999authorSep 09.2005 — sorry for the java/javascript mixup... anyway, thanks for the response, that helped a bit. but now i'm trying to figure out how to get that js variable into a php variable.

and as far as referencing the value in my script - the value is needed for filtering a php dropdown... so if that's possible, that would be perfect, otherwise, any help on the above mentioned issue would be great. Thanks again.
Copy linkTweet thisAlerts:
@A1ien51Sep 09.2005 — To get into php, you need to post back the form to the server. JavaScript can not talk to php since the server and client are two seperate things.

Eric
×

Success!

Help @Crono999 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 5.17,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...