Hello Friends....... in my project i am having a dropdown and based on the values selected from the dropdown, i have to enable 2 radio button. in the on change function of drop down i have written the code. but radio button is not getting enabled, it just blinks and get disabled. this is the code... radio button is disabled by default.[php]<select name="tak" class="style21" onChange="tlkdi sp(document.for m1)">function tlkdisp(Object)
{
var index=Object.ta k.selectedIndex ;
var value=Object.ta k.options[index].value;
if(Object.tak.o ptions[index].value >0 )
{
document.form1. radiobutton[0].disabled=false ;
document.form1. radiobutton[1].disabled=false ;
document.form1. radiobutton1[0].disabled=false ;
document.form1. radiobutton1[1].disabled=false ;
}
document.form1. action="Vr.php? tak="+value;
document.form1. submit();
return false;
}[/php]
thanks......... .....
11 9298 TheServant 1,168
Recognized Expert Top Contributor
Looks like javascript to me? And it sounds like something you would need javascript for anyway. PHP cannot do this alone, so if you don't want to use javascript you will need AJAX. A moderator should move this to the javascript forum soon.
warning:
Please enclose your posted code in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use [code] tags in future.
MODERATOR
What has this got to do with PHP??
I'll move this to the JavaScript forum.
moderator
acoder 16,027
Recognized Expert Moderator MVP
Hello Friends....... in my project i am having a dropdown and based on the values selected from the dropdown, i have to enable 2 radio button. in the on change function of drop down i have written the code. but radio button is not getting enabled, it just blinks and get disabled. this is the code... radio button is disabled by default.
Show the HTML code. Do you get any errors?
Hello friends..... is it possible to enable radio button in the "onchange" function of an dropdown list using java script in php.
function tlkdisp(Object)
{
var index=Object.ta k.selectedIndex ;
var value=Object.ta k.options[index].value;
document.form1. radiobutton[0].disabled=false ;
document.form1. radiobutton[1].disabled=false ;
document.form1. action="Vresurv ey.php?tak="+va lue;
document.form1. submit();
return false;
}
<select name="tak" class="style21" style="font-family:MLB-TTRevathi" onChange="tlkdi sp(document.for m1)"
this is my code... but i am not able to enable the radio button, it just blinks when i select the dropdownlist..
thanks.
Markus 6,050
Recognized Expert Expert
Hello friends..... is it possible to enable radio button in the "onchange" function of an dropdown list using java script in php.
function tlkdisp(Object)
{
var index=Object.ta k.selectedIndex ;
var value=Object.ta k.options[index].value;
document.form1. radiobutton[0].disabled=false ;
document.form1. radiobutton[1].disabled=false ;
document.form1. action="Vresurv ey.php?tak="+va lue;
document.form1. submit();
return false;
}
<select name="tak" class="style21" style="font-family:MLB-TTRevathi" onChange="tlkdi sp(document.for m1)"
this is my code... but i am not able to enable the radio button, it just blinks when i select the dropdownlist..
thanks.
This has nothing to do with php.
Regards
Hello friends..... is it possible to enable radio button in the "onchange" function of an dropdown list using java script in php.
function tlkdisp(Object)
{
var index=Object.ta k.selectedIndex ;
var value=Object.ta k.options[index].value;
document.form1. radiobutton[0].disabled=false ;
document.form1. radiobutton[1].disabled=false ;
document.form1. action="Vresurv ey.php?tak="+va lue;
document.form1. submit();
return false;
}
<select name="tak" class="style21" style="font-family:MLB-TTRevathi" onChange="tlkdi sp(document.for m1)"
this is my code... but i am not able to enable the radio button, it just blinks when i select the dropdownlist..
thanks.
I'd recommend looking for an AJAX solution to this - shouldn't be terribly difficult!
Markus 6,050
Recognized Expert Expert
I'd recommend looking for an AJAX solution to this - shouldn't be terribly difficult!
Pointless using ajax when there's a pure (and incredibly basic) javascript solution. Using ajax would take up unecessary server resources.
Ask in the JS forum
Hello friends..... is it possible to enable radio button in the "onchange" function of an dropdown list using java script in php. - function tlkdisp(Object)
-
{
-
var index=Object.tak.selectedIndex;
-
var value=Object.tak.options[index].value;
-
document.form1.radiobutton[0].disabled=false;
-
document.form1.radiobutton[1].disabled=false;
-
document.form1.action="Vresurvey.php?tak="+value;
-
document.form1.submit();
-
-
return false;
-
}
<select name="tak" class="style21" style="font-family:MLB-TTRevathi" onChange="tlkdi sp(document.for m1)"
this is my code... but i am not able to enable the radio button, it just blinks when i select the dropdownlist..
thanks.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: EviL KerneL |
last post by:
Hi -
I am trying to figure out a way to enforce the validation included for
this form based on whether the user chooses "email" or "phone" as the
contact choice. Right now it is set to enforce validation on both.
Is there a way to link the drop-down choice to the correspondent
validation section while disabling validation for the other one?
here's what I presently have:
|
by: Mike Griffin |
last post by:
I would like to have a drop down box where when the user selects one of the
choices, it automatically loads another page. I want this to be a one stop
select and go. No submit or OK button. Just drop down, select the page and
off it loads. Is this possible with JS?
Thanks in Advance
Mike
(Who is a newbie)
|
by: tpaulson |
last post by:
I have a couple of DIV's that I hide/display based on radio buttons.
On the DIV's, I have multiple drop down boxes. The source shows that
they are populated, but I can't make them drop down. Only click on the
Unplatted Radio button, the rest isn't functional, yet. Any ideas how
to make these drop down in FF. This works in IE. Here is the code:
<HTML>
<HEAD>
<TITLE>Door County Register of Deeds - Tract Inquiry</TITLE>
|
by: Joe Attardi |
last post by:
Hi all,
On a form on one of my pages I have two <select> elements, and each one
is paired up with a radio button. The idea is to choose an item from
one list or the other and select the radio button of the list you want
to use.
I'm using JavaScript to automatically select the radio button
corresponding to a list when you click on the list (using the onclick
event handler). Is that the best event to change on, or should this
|
by: Sujoan |
last post by:
Hi,
I would like to add a button with drop down menu to standard toolbar
in internet explorer(like the mail button). Is it possible to do that
using C#? Please somebody give some information on this.
With Regards,
Sujoan.
| |
by: donald |
last post by:
Hi there,
Is there a button which i can use of a form which has a button and a
arrow next to it with a list of other buttons. Like New in Outlook or
Undo in Word?
Is there on in the .NET Framework?
Thanks
|
by: s.chelliah |
last post by:
Hi,
I am trying to use javascript, div tag and radio button to
disable/enable a text box. It works fine
in netscape and firefox, but in IE, the text box is not disabled when
the user checks the radio button.
Note that I am using two div statements. Any other solutions also
wellcome.
<html>
|
by: vinceboy |
last post by:
Hi..guys!I have a drop down menu with javascript null validation.However,instead of clicking submit button,it will immediately auto redirect after option was selected.Is it possible to prevent this kind of fast respond?
<select name="rNumber" title="number of ticket"
onChange="GoToNextPage(this.value)">
<option selected>Select</option>
<option>01</option>
...
|
by: daydreaming |
last post by:
Hi All,
I would like to know is there any way to set the color of the button in drop-down menu.
Below is the sample HTML object (select) that I would like to set its button color.
<html>
<select style="border-bottom:1px solid #dadada">
<option>Menu Item 01</option>
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |