Suppose my URL like "http://localhost/news/Slavo/virsion/sitefinity-sdk-was-released".
i want to display this url like "http://localhost/news/Slavo/006".
How can i do this..?
actually i want to use this solution when i setect a option to goto a new page.
<script type="text/javascript">
function changeFunc() {
var selectBox = document.getElementById("selectBox");
var selectedValue = selectBox.options[selectBox.selectedIndex].value;
// alert(selectedValue);
if( selectedValue =="Others"){
alert(selectedValue);
// goto a new page;
$url = "http://localhost/new/select_university.php";
$replace = array("http://localhost/new/", ".php");
$by = array("http://localhost/new/NewPage", ".php");
$newurl = str_replace($replace, $by, $url);
window.location.href = $newurl;
}
}
<select id="selectBox" onchange="changeFunc();">
<option value="001">001</option>
<option value="002">002</option>
<option value="Others">Others</option>
</select>
Aucun commentaire:
Enregistrer un commentaire