Link to home
Start Free TrialLog in
Avatar of Cy2
Cy2

asked on

Javascript onclick event

I've seen what is described below done on an adobe pdf file, and it apparently is javascript, but I am unable to see how it is coded.  I would like to do the same thing on a JSP page.  It would be great if I could add this feature to a java web app that I'm working on.

The adobe pdf file is an online form, where the user can click on a certain area / text field asking for the user's name, and a javascript pop up window will appear, allowing the user to enter his last name, first name, and middle initials.  There are two buttons on the popup window for OK, to insert the information into the blank text field OR cancel to close the popup window.

The name data that is entered gets populated/formatted into the name text filed as Last Name, First Name MI.

I've attached a document showing what I describe, but I'm not sure whether or not the images will be viewable, so that is why I've tried describing the feature as best as I can.

As far as what I've seen in JS tutorials, the onclick is only used for buttons.  Can it work for empty text fields on a jsp as well?  I tried placing the onclick="show_popup()" within a <input  > element, which would be the textbox, but clicking on the text box did not result in the window coming up.
SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cy2
Cy2

ASKER

Thanks for all the feedback.  Sorry I wasn't able to respond back or award points in a timely fashion as I was pulled away from this issue to something else.  I will need to look at the posted solutions again and see which is the most helpful, though I basically know nothing about jquery and only limited javascript and basic html.   I may post another follow-up question related to this question later.  Meanwhile, I just split the points among all respondents.