I am feeling pretty generous, as you are a beginner, try to work with this as a base and work out what you need to do to get the desired results, this is as close as you are going to get to what you want.
Excuse the translations, you have google to thank for that.
If you need help understanding any of it and why I went down this particular route / method then let me know what it is and I will answer as best I can so you can understand.
The only proviso I have on this is you give some credit and the URL remains in the page.
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>מחשבון הריון על ידי \ \. \</title>
<style>
textarea,select{direction:rtl;}
</style>
<script>
/*
Script on :
http://www.webdeveloper.com/forum/showthread.php?287245-pregnancy-calculator-script
Based on original script by : \\.\
*/
monthName = { "Jan":"ינואר",
"Feb":"פברואר",
"Mar":"מרץ",
"Apr":"אפריל",
"May":"מאי",
"Jun":"יוני",
"Jul":"יולי",
"Aug":"אוגוסט",
"Sep":"ספטמבר",
"Oct":"אוקטובר",
"Nov":"נובמבר",
"Dec":"דצמבר"
}
dow = {
"Sun":"יום ראשון",
"Mon":"יום שני",
"Tue":"יום שלישי",
"Wed":"יום רביעי",
"Thu":"יום חמישי",
"Fri":"יום שישי",
"Sat":"יום שבת"
}
// get selected date
function selectedDate(){
// create a date string that the date object understands
with( document.dateValue ){
dateStr = [ dayMonth[ dayMonth.selectedIndex ].value,
monthName[ monthName.selectedIndex ].value,
yearSelect[ yearSelect.selectedIndex ].value
].join(" ");
}// end of with
res = new Date(dateStr+ " 00:00:00");
conceive = res.toUTCString().slice(0,16);
// gestation =
gestation = ((365/4)*3)+14; // gets days
res.setDate( gestation );
birth = res.toUTCString().slice(0,16);
// generate a message
str = "בהנחה שאתה הגה במועד ניתנו כ "+conceive+" ותקופת ההריון שלך היא "+gestation+" ימים, המועד הצפוי של לידה יהיה סביב "+birth;
// replace days of week and month names
str = str.replace( conceive.slice(0,3), dow[ conceive.slice(0,3) ] );
str = str.replace( conceive.slice(8,11), monthName[ conceive.slice(8,11) ] );
str = str.replace( birth.slice(0,3), dow[ birth.slice(0,3)] );
str = str.replace( birth.slice(8,11), monthName[ birth.slice(8,11) ] );
document.dateValue.outputMessage.innerHTML = str;
}
</script>
</head>
<body>
<form id="dateValue" name="dateValue" method="post" action="javascript:;" onSubmit="selectedDate(); return false;">
<p>
<select name="dayMonth">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
/
<select name="monthName">
<option value="Jan">ינואר</option>
<option value="Feb">פברואר</option>
<option value="Mar">מרץ</option>
<option value="Apr">אפריל</option>
<option value="May">מאי</option>
<option value="Jun">יוני</option>
<option value="Jul">יולי</option>
<option value="Aug">אוגוסט</option>
<option value="Sep">ספטמבר</option>
<option value="Oct">אוקטובר</option>
<option value="Nov">נובמבר</option>
<option value="Dec">דצמבר</option>
</select>
/
<select name="yearSelect">
<option value="2013">2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
</select>
<input type="submit" name="Submit" value="Submit" />
</p>
<p>
<textarea name="outputMessage" cols="50" rows="3"></textarea>
</p>
</form>
</body>
</html>
Is that any good to you?