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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.