Jump to content

I want to disable it as soon as a value from dropdown has been selected


mubeensamoon

Recommended Posts

Moved.

 

Are you sure you want to use a dropdown for after they've made their selection? It's not like they can change it anymore.

I suggest you reconsider whether you want to prevent the user from changing their mind, or else use Javascript to change the input entirely - like from a dropdown to a hidden input and plain text.

<select name="foo">
<option value="value1">Option 1</option>
<option value="value2">Option 2</option>
</select>
<input type="hidden" name="foo" value="value1">
Option 1

Can you help me to write javascript for the above? And also let me know the below query

 

I have two buttons namely "Submit" and "Add" in a web page. I want to disable submit button if I click on Add and vice versa.

 

Thanks.

Use two forms. Besides the fact that having those two buttons on the same form would be confusing, if someone chooses a file to upload and then hits Submit, the file still gets uploaded. If you use two separate forms then you avoid that.

Hi

 

Form 1

<?php 
 
$this->renderPartial('_form', array('modelRebate'=>$modelRebate,'modelUploadAnn'=>$modelUploadAnn)); ?>
 
 
<h3>File Uploader</h3>
 
Form 2
 
<?php 
//Defining the modelUploadedImage
$modelUploadAnn->file_prf = $modelRebate->rebate_prf;
$this->renderPartial('/files/uploadAnn',array('modelUploadAnn'=> $modelUploadAnn));  ?>
 
 
 
I am using the above two forms for the buttons but I am not able to arrive at the answer.
 
 
 
How to disable the one when the other one is selected.???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.