How it supposed to work: User starts typing in a textbox. If the textbox is populated with something, i show a div with 3 radiobuttons. If the user clicks one of the radiobuttons a postback on the server is made and we retrive some data. If the user clears the textbox we should uncheck the radiobuttons and hide their container. In the next step the user writes another value in the textbox and the radiobuttons appears on the screen, with neither of them selected.
Unfortunately, if the user selects the previously selected radio, the postback (selectionchangedhandler) on the server is not fired, presumably because i didn't unchecked correctly the radio button.
Do you have any ideas hot to make this work? I can't modify the c# source code because the website is generated from a CMS
tl;dr how to notify that we have no more a selectedIndex in a radioButtonGroup in c# from javascript?
Related
I'm quite new to C# and asp.net and have been struggling for a few days to sort out what seems to be something simple. I've got two pages lets call it page1.aspx and page2.aspx
page1.aspx
I've got two dropdownlists with a continue button. Once the continue button is clicked it will populate data specified in my sql statement. On the first column I've got a hyperlink 'view' and in the last column I've got checkboxes which are disabled. Once I click on the view hyperlink it takes me to page2.aspx which has a button Tick and Untick which ticks the checkbox on page1.aspx
page2.aspx
On this page I've got three buttons (back, tick, untick) the tick and untick buttons is just to tick or untick the disabled checkboxes on page1.aspx. On the back button I'm trying a response.redirect('page1.aspx'); however when I get redirected the dropdownlist is empty and it doesnt repopulate the previous selected criteria to show the newly ticked or unticked checkbox.
What I've tried
I tried a function
function fnHistory() {
window.history.go(-1);
}
on the back button of page2.aspx this does keep my dropdownlist values on page1.aspx however it doesnt display the newly ticked checkbox since the page needs to be refreshed and refreshing the page takes away the dropdown values.
I tried to do a page refresh every 5 seconds on the div where the sql data gets displayed this is however not a option as its just bad practice.
I've tried update panel on page 1 for the div where the sql data gets displayed however the trigger which should be the tick and untick button is on page2.aspx
Your help and advice will be highly appreciated.
Is there anything unique on page2 that you have to open it in another window?
What about opening the 2nd page in a modal? So you can get access to page1 directly.
I'm trying to set up a Material-ui <RadioGroup> for a survey tool without a submit button. I want the selection to be processed when the <Radio> is clicked. Using RadioGroup's onChange() this works fine if there is no Radio selected yet. But if I go backwards through the survey, the previous questions have their Radio pre-selected. In this case, when I click the Radio that is already selected, onChange() does not fire so I can't move forward to the next question.
I've tried using onClick() instead, but this only works if the user clicks the Radio button. If they click the label instead, the event value is undefined.
I have an input field and two radio buttons. I would like to evaluate the form data whenever the form has changed. Strictly speaking, I want to react to the blur event of the input field. However, there is a situation where a user enters a value in the input field and (without pressing enter or clicking anywhere with the mouse) clicks directly on the radio buttons. Now there is the effect that the radio buttons are visually displayed to the user as checked, but the blur event is already fired. At this point, no radio button was technically checked yet.
For technical reasons, however, the radio selection must already exist in the form.
So my question is: Is it possible to check at the blur event whether the user has clicked on a radio button? It is about firing the event afterwards in such a special case (so that the selection of the radio button can be included in an evaluation).
(By the way: I use angular for my project. Just in case this could make a difference.)
Thanks in advance.
There is an ASP form which I need to fill recurringly so I thought of automating the process. But the thing is it only accepts user clicks and no other input method. That is, it records input only when user clicks on the radio button. I tried using:
document.getElementsByName("elementName").value = my_value;
but it doesn't seem to work. Is there a way around this?
I have seen many checkbox examples, but not this one.
I need a checkbox to remain checked if data is present in specific <input> fields. So it would need to be something that is constantly checking field status.
Basic checkbox:
<input class="checkbox" type="checkbox" unchecked onclick="shipping()"/>
It calls a function that removes a <div> and adds a shipping info page. There is a back button there that will remove shipping page and add orig. If they entered shipping data I want that checkbox to be checked. Now if they click it again, the data they entered on the shipping page would disappear. And process can be repeated.
This is a PHP page so I am comfortable using javascript, jQuery or PHP. Just looking for the most reliable way.
JavaScript is the way to go because PHP can't react to what's happening in the browser. I would register an onchange event handler to the input that drives the checkbox. When the input is altered (ie when the handler is triggered):
Read the value, and if it is empty then...
Enable the checkbox.
Else, disable the checkbox and set it as checked
This should prevent a user of the UI from unchecking the box while there is content in the input