| | |
mixing php, javascript and html: please help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Feb 2009
Posts: 10
Reputation:
Solved Threads: 0
Hello every one, i am new here so i would appreciate any help wit this.
i am trying to call a url using javascript in an html select statement as follows;
echo "<select>";
for ($i = 0; $i < $pages; $i++) {
?>
<option value=''
onClick='javascript:window.location.href= "index.php?option=<?php echo $option; ?>&task=view&limit=<?php echo $lmt * $i; ?>&id=<?php echo $idpik; ?>&Itemid=<?php echo $Itemid; ?>"'><?php echo $i; ?></option>
<?php
}
echo "</select>";
however, this works in other browsers except IE6. please help me out. thank you. i luv this forum already
i am trying to call a url using javascript in an html select statement as follows;
echo "<select>";
for ($i = 0; $i < $pages; $i++) {
?>
<option value=''
onClick='javascript:window.location.href= "index.php?option=<?php echo $option; ?>&task=view&limit=<?php echo $lmt * $i; ?>&id=<?php echo $idpik; ?>&Itemid=<?php echo $Itemid; ?>"'><?php echo $i; ?></option>
<?php
}
echo "</select>";
however, this works in other browsers except IE6. please help me out. thank you. i luv this forum already
here is how i would do it
PHP Syntax (Toggle Plain Text)
echo '<select onchange="javascript:window.location.href=this.value">'; for ( $i=0,$i<$pages,$i++ ) { echo "<option value=\"index.php?option={$option}&task=view&limit=". $lmt * $i . "&id={$idpik}&Itemid={$Itemid}\">{$i}</option>"; } echo '</select>';
•
•
Join Date: Feb 2009
Posts: 10
Reputation:
Solved Threads: 0
Thanx alot, @kkeith29 this works perfect in both FF and IE6.
i luv this site.
i have another problem though. this code below works in FF but not in IE.
any help will be appreciated. thanx again @kkeith29, you have made my day.
i luv this site.
i have another problem though. this code below works in FF but not in IE.
PHP Syntax (Toggle Plain Text)
<option value='district' onClick='javascript:javaFunctiondistrict();'>district</option>
any help will be appreciated. thanx again @kkeith29, you have made my day.
•
•
Join Date: Feb 2009
Posts: 10
Reputation:
Solved Threads: 0
yes there is a function for each option.
no its not in the same form. here is the whole select statement
and here is one of the functions;
no its not in the same form. here is the whole select statement
PHP Syntax (Toggle Plain Text)
<select name='field_general' size='1' class='inputbox' id='field_city'> <option value='allgene'>...select...</option> <option value='district' onClick='javascript:javaFunctiondistrict();'>district</option> <option value='gender' onClick='javascript:javaFunctiongender();'>Gender</option> <option value='status' onClick='javascript:javaFunctionstatus();'>status</option> <option value='type' onClick='javascript:javaFunctiontype();'>type</option> </select>
PHP Syntax (Toggle Plain Text)
function javaFunctionschool(){ var url="index.php?option=com_artband&Itemid=73?action=phpFunctionSchool"; window.open(url, "_self"); }
![]() |
Similar Threads
- passing variables from php/html to java scripts (PHP)
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- delete and refresh search results (JavaScript / DHTML / AJAX)
Other Threads in the PHP Forum
- Previous Thread: onclick confirm on button help
- Next Thread: in_array(): wrong datatype for second argument
Views: 697 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube






