Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP: Disable Enable text box on the basis of dropdown
    primarykey
    data
    text
    <p>I'm new to PHP. i am trying to create some html code within a php function as below.</p> <hr> <pre><code>$str .="&lt;/div&gt; &lt;div class='cls_setpadding'&gt; &lt;form method='get' action='homepage.php'&gt; &lt;div class='cls_caller_options'&gt; &lt;select name='test'&gt; &lt;option value='allcaller'&gt;".getResourceStrings('msg_allcaller',$lng)."&lt;/option&gt; &lt;option value='specialcaller'&gt;".getResourceStrings('msg_splcaller',$lng)."&lt;/option&gt; &lt;/select&gt;&lt;br /&gt; &lt;/div&gt; &lt;div class='cls_msg_splcaller'&gt;"; $str .= getResourceStrings('msg_spcallaer',$lng); $str .=" &lt;/div&gt; &lt;div style='padding-top:2%'&gt;&lt;/div&gt; &lt;div class='cls_search_box'&gt; &lt;input type='hidden' name='function' value='Buysuccess' /&gt; &lt;input type='hidden' name='vcode' value='".$vcode."' /&gt;"; if($testmsisdnheader != ""){ $msisdn_header = getheader(); $str .="&lt;input type='hidden' name='".$msisdn_header."' value='".$msisdn."' /&gt;"; } $str .=" &lt;input type='text' onkeydown='return ( event.ctrlKey || event.altKey || (47&lt;event.keyCode &amp;&amp; event.keyCode&lt;58 &amp;&amp; event.shiftKey==false) || (95&lt;event.keyCode &amp;&amp; event.keyCode&lt;106) || (event.keyCode==8) || (event.keyCode==9) || (event.keyCode&gt;34 &amp;&amp; event.keyCode&lt;40) || (event.keyCode==46) )' name='cbsmsisdn' maxlength='12' disabled='true'/&gt;&lt;br /&gt; &lt;div style='padding-top:1%'&gt;&lt;/div&gt; &lt;input type='submit' value='Submit' /&gt;&lt;br /&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt;"; </code></pre> <hr> <p>Now I want to enable/disable the text box on the basis of value selected in drop down.</p> <p>Here i like to put a condition where if the option value equals 'allcaller' the text box should be disabled which is actually happening. But I want to enable the same text box in case option value equals to 'specialcaller'.</p> <p>I wasn't able to enable the text box on the basis of value selected in drop down.</p> <p>Any help would be highly appreciated.</p> <p>Thanks! Bobby.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload