עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

עוד בעיה עם PHP וג'אווהסקריפט

Featured Replies

פורסם

יש לי את הקוד הנל

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script language="javascript" src="jscript.js"></script>
<title></title>
</head>
<body>
<?php
include 'sqlfunc.php';
include 'UserClass.php';
$platform=get_platform();
session_start();
$user=$_SESSION['user'];
$test="dfgfdg";
$last_bug=get_last_bug_number();
?>
</body>

<div id=newbug><table border=0 cellspacing=20 valign=center>
<caption align=center> New Bug Form</caption>
<form action=welcome.php method=post>
<tr>
<td>
Bug Id:<input type=text size=6 name=lname disabled=disabled value="<?php print_r($last_bug); ?>">
</input>
Project name:<SELECT NAME="project" id="ts" onchange=javascript:test(this.value)>
<option> test1 </option>
<option> test4 </option>
<option> test2 </option>
</select>
</tr>
</td>
</form>
</table></div>
</html>

הבעיה בשורה הזו

             Project name:<SELECT NAME="project" id="ts" onchange=javascript:test(this.value)>

הבעיה שהפונקציה test לא מדפיסה לי כלום היא מביאה לי חלון ריק...למישהו יש מושג למה?

הפונקציה test היא זו:

function test(theSel)
{
alert(theSel);


}

פורסם

ל Select אין Value.

ומתי תבין שזה לא PHP?

ובמקום לפתוח כל פעם נושא חדש אולי פשוט תרכז את כל השאלות שלך בנושא הזה?

פורסם
  • מחבר

קודם כל תודה

דבר שני ...אתה צודק החלק הזה דווקא לא PHP אלה HTML ולא שמתי את זה באותו אשכול כי לא רציתי לערבב בין האשכולים והשאלות

דבר שלישי לעניינו ...אז איך אני כן יכול לקבל את הערך שנבחר?

ושוב תודה על העזרה ומצטער על הבלאגן

פורסם


Project name: <select name="project" id="ts" onchange="test(this)" />


function test(sel) {
var value = sel.options[sel.selectedIndex].value;
}

פורסם
  • מחבר

תודה רבה...משום מה הדרך שהבאת לי לא עבדה לי אבל השתמשתי ברעיון מה שעבד לי בסוף זה :

var Loption=document.getElementById("project");
var result=Loption.options[Loption.selectedIndex].text;
alert(result);

אבל שוב תודה

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.