/    Sign up×
Community /Pin to ProfileBookmark

Picture to prompt box?

Hey there, my name is Chris and i’m 16 years old, currently i’m doing a selvchosen obligatorial assignment, and i wanted to make this calculator in javascript, the thing i want help with is pictures to the first prompt box, in the code below, is that possible?

Let me know if you want the full code, i have it all but i think the post will be pretty long if i post it all

So to narrow it down: Is it possible to get a picture into a prompt box?

[code]<HTML>
<HEAD>
<TITLE>title here</TITLE>

<SCRIPT language=”javascript”><!–

function CirkelAreal()
{
number = prompt(“indskriv radius her”, “RADIUS”);
numbertwo = prompt(“indskriv værdi her(centimeter/milimeter/decimeter/kilometer Brug forkortelser “, “Værdi”);
total = number * number * 3.14;

alert (“Areal af cirklennnn” + number + ” ^ 2 * 3.14(pi) = ” + total + ” ” + numbertwo + “2” );
}

//–></SCRIPT>

</HEAD>
<BODY>

<A HREF=”javascript:CirkelAreal()”>Areal af cirkel ved brug af radius</A>
]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@LeonsbuddydaveFeb 10.2008 — As far as I know, there is no way to put images in a prompt box. One way to do it would just have a popup with a form in it, that way it could have images.
Copy linkTweet thisAlerts:
@cgishackFeb 10.2008 — You have no control over the prompt input box.

Like LeonsBuddyDave said, the best way is to create a custom prompt.

Here is a crude example you can work with if you wish
<i>
</i>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;

&lt;style type="text/css"&gt;
&lt;!--
#customPrompt {
position:absolute;
left:65px;
top:69px;
width:279px;
height:143px;
z-index:2000;
background-color: #FF9900;
}
--&gt;
&lt;/style&gt;



&lt;script type="text/javascript"&gt;

function showEl(id)
{
var el = document.getElementById(id);
el.style.display = "";

}
function hideEl(id)
{
var el = document.getElementById(id);
el.style.display = "none";

}
&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;!-- CUSTOM FLOATING PROMPT --&gt;
&lt;div id="customPrompt" style="display:none;"&gt;
&lt;p&gt;Enter some number&lt;/p&gt;
&lt;p&gt;
&lt;input type="text" id="myNumber" /&gt;
&lt;input type="submit" name="button" id="button" value="Submit" onClick="hideEl('customPrompt')" /&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;!-- END CUSTOM PROMPT --&gt;


&lt;a onclick="showEl('customPrompt')" style="cursor:pointer;"&gt; Open Prompt &lt;/a&gt; &lt;br /&gt;
&lt;/body&gt;
&lt;/html&gt;



Drew
×

Success!

Help @mobifon 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.19,
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,
)...