Jump to content

how to prompt for male or female?


frijole

Recommended Posts

to tell you the truth, your better off with a div overlay than a prompt dialog.  I know this probably changes everything for you, but I know you can do ANYTHING with the div.

 

just do something like

 

var newDiv = document.createElement('DIV');
newDiv.width = 300;
newDiv.height = 300;
newDiv.position = "absolute";
newDiv.top = document.body.clientHeight/2;  // horizontally center
newDiv.left = document.body.clientWidth/2;  // vertically center
newDiv.innerHTML = "<form action='' method=''><select name='info'><item name='male'>male</item><item name='female'>female</item></select></form>

 

document.body.appendChild(newDiv);

 

 

i didnt test this, so it may not be 100% but thats the main idea

 

 

so that will put a div with custom html inside of it on the page.  And then you can add more to that html that would call a function which would make the div go away

 

document.body.removeChild(newDiv);

 

oh and if the prompt is onLoad you can add to the body  <body onload="placeDiv();"> and just have that run the code above, or similar

Link to comment
Share on other sites

Thanks for the thorough answer. For my specific case I need to somehow prompt if they are male or female. I would prefer not to just have them type it in because I would have to verify the data that way. Is there any way to have a prompt that gives 2 options to choose from? All JavaScript too? Thanks for the help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.