- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 01:14 AM
Hi All,
i am one error in this script ,
1.In the portal all the field value are showing whenever user click all the three buttons but i want if the user select button 2 automatic button1 "Choose an option" should removed . I am not able to know how to write array to resolve this issue
2.whenever any select any one of the options it should save in the login user record .Can anyone help me to resolve the issue .
HTML:
<div>
<button ng-click="c.open()" >button1</button>
<button ng-click="c.open1()" >button 2</button>
<button ng-click="c.open2()" >button3</button>
<div ng-if="data.showfield">
<label for="selectBox">Choose an option:</label>
<select id="selectBox" ng-model="data.selectedOption">
<option value="">--Select an option--</option>
<option value="a">Option A</option>
<option value="b">Option B</option>
<option value="c">Option C</option>
</select>
</div>
<div ng-if="data.showfield1">
<label for="selectBox">Choose an option:</label>
<select id="selectBox" ng-model="data.selectedOption">
<option value="">--Select an option--</option>
<option value="a">Option A</option>
<option value="b">Option B</option>
<option value="c">Option C</option>
</select>
</div>
<div ng-if="data.showfield2">
<label for="selectBox">Choose an option:</label>
<select id="selectBox" ng-model="data.selectedOption">
<option value="">--Select an option--</option>
<option value="a">Option A</option>
<option value="b">Option B</option>
<option value="c">Option C</option>
</select>
</div>
</div>
Client script:
server scipt:(function() {
data.showfield=false;
})();
if you lick all the three buttons latest options should visible and other two should be removed.
Please help me
Thanks ,
Chandan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 02:59 AM
Hii @chandanpatra Just Make Some Changes In Client Script
api.controller=function(){
var c = this;
// Initialize the data
// Initially hide the select box
c.open=function(){
// Toggle the visibility of the select box
alert('test');
c.data.showfield=true;
c.data.showfield2=false;
c.data.showfield1=false;
alert(c.data.showfield)
}
c.open1=function(){
// Toggle the visibility of the select box
alert('test');
c.data.showfield1=true;
c.data.showfield=false;
c.data.showfield2=false;
alert(c.data.showfield)
}
c.open2=function(){
// Toggle the visibility of the select box
alert('test');
c.data.showfield2=true;
c.data.showfield1=false;
c.data.showfield=false;
alert(c.data.showfield)
}
};
@
Thank You !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 02:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 02:59 AM
Hii @chandanpatra Just Make Some Changes In Client Script
api.controller=function(){
var c = this;
// Initialize the data
// Initially hide the select box
c.open=function(){
// Toggle the visibility of the select box
alert('test');
c.data.showfield=true;
c.data.showfield2=false;
c.data.showfield1=false;
alert(c.data.showfield)
}
c.open1=function(){
// Toggle the visibility of the select box
alert('test');
c.data.showfield1=true;
c.data.showfield=false;
c.data.showfield2=false;
alert(c.data.showfield)
}
c.open2=function(){
// Toggle the visibility of the select box
alert('test');
c.data.showfield2=true;
c.data.showfield1=false;
c.data.showfield=false;
alert(c.data.showfield)
}
};
@
Thank You !