|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Passing a PHP array variable to javascript
Hi
Hopefully one of you can help me, or even provide me with an alternate solution. I have the following problem I've got this code inside a while loop <td> R<input class='cellinputred' type='text' size='8' maxlength='8' name='ActualAmount[". $DisplayData["{$type}_id"] ."]' disabled> </td> <td> <input type='checkbox' name='DisplayID[]' value='". $DisplayData["{$type}_id"] ."' onclick='EnableDisable(\"". $DisplayData["{$type}_id"] ."\");'> </td> I'm trying to disable/enable the ActualAmount[] input, depending on whether the DisplayID[] checkbox is ticked or not. Heres the java <script language="JavaScript" type="text/javascript"> function EnableDisable(object) { if(document.forms.BudgetForm.element["DisplayID[]"].checked) { document.forms.BudgetForm.elements["" +object+ ""].disabled = true; } else { document.forms.BudgetForm.elements["" +object+ ""].disabled = false } } </script> Forgive my lack of javascripy knowledge, i am working on it though ![]() Thanks, PaulO |
|
#2
|
|||
|
|||
|
Try this
<head> <script language="JavaScript"> function JS_Help(arg1) { alert(arg1); } </script> </head> <body> <? $Test = "Blah"; ?> <script language="JavaScript"> JS_Help("<?=$Test?>"); </script> </body> You can pass any values this way |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Passing a PHP array variable to javascript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|