SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a button, when i click on button i need a popup which should have textbox and a button "ok". in textbox i can enter numerical values like 10, 12 etc and click on ok button. Later ok button click fires a method. It is possible? Can anyone tell me the steps and code to perform the same. any javascript? i have to integrate this feature in one sharepoint webpart. Do i need to write any javascript for the same?

share|improve this question
of course you can make a dialog window and have there some input. what did you do so far? – Gwny Jul 23 '14 at 7:41
i have not started it yet, can you let me know the process and code for the same please – Brishal Jul 23 '14 at 13:23
what do you want to do with this values?? – Gwny Jul 23 '14 at 13:27

Here is a short hint for your solution: HTML:

<input type="button" id="test" value="klick"></input>
<label id="label"></label>


document.getElementById("test").onclick= function (){
var person = prompt("Please enter your name", "Harry Potter");
if (person != null) {
//do some stuff if ok is clicked and value entered  
        document.getElementById("label").innerHTML =
        "Hello " + person + "! How are you today?";
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.