Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alert Box with form and one input text [closed]

Tags:

javascript

I want to open an alert box (Javascript) with one input text, then on user click is submit to another page, its like a form with one input text, all the examples that given are modals examples, i just need an alertbox.

like image 473
Ofir Attia Avatar asked Feb 11 '13 08:02

Ofir Attia


People also ask

How do I display form data in alert box?

Once the form is completed, the button is clicked and an alert box pops up showing the form data entered.

How do you take input in alert box?

A prompt box is often used if you want the user to input a value before entering a page. When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value. If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box returns null.

How do you show input value in alert?

You are calling alert() with DOM element #message as parameter. To correct this you can pass . value property of #message : message to alert(message. value) .

How do I customize my alert box?

The standard alert box in JavaScript does not provide the option to apply CSS. To style your alert box, you need to create a custom one first. The custom alert box will be created using jQuery and styles will be applied to CSS.


1 Answers

Assuming I've understood your question correctly, you can use the DOM prompt method:

var result = prompt("Enter a value");
like image 101
James Allardice Avatar answered Sep 21 '22 17:09

James Allardice