I have an application which looks something like as shown in picture
To achieve this I've written some code and here is my code jsfiddle. As i think the way which i followed is not a right one, so can anyone please suggest some better way to get something as shown in picture using jquery-mobile, html, javascript. And one more thing is when i click on save button i should able to display the status of every field whether it is accepted or rejected based on the radio button selection.Can anyone please help me how to do this?
Updated fiddle here http://jsfiddle.net/janakipriya/hRzZf/17/
I have tried something you can check it here http://jsfiddle.net/hRzZf/2/ it will give you status of check radio
Related
I run a large Discord server and I'm making a channel for people to post template information about their online groups. To make complying with the template either, I've created a single HTML page which takes the information that goes in the template and regurgitates it into a box on the bottom of the page with some nice bolding and italics where needed already for copy/paste.
Unfortunately, I don't know Javascript so I'm just trying to piece things together and learning as I go. (I'm learning other languages but not this one in school.)
For some reason me trying to format code on here isn't working so I can't paste what I have so I'll just try and explain it.
I'm using oninput="groupNameFunction()" and I'm having the javascript grab the user entered data as they type it via grabbing the ID of the input field then regurgitating it out in the innerHTML of another element. And it works great.
But checkboxes (and probably radio buttons) don't work with oninput (for pretty obvious reasons) but I've been able to get onblur to work to some extent.
The problem is that I'm a beginning coder and I don't quite know or understand how I'll take all the results from all the checkboxes and regurgitate them out into a nice list when there are many IDs and many choices and it doesn't seem sensible to try and write all choices from a single thing into their own function, or how I'll handle the same thing with radio buttons.
I can't find any examples in stuff like W3 tutorials of this being done, it's probably that I just don't know the language to google it correctly.
Could someone point me in the right direction on how to make this work?
here's a little fiddle for you to play with. (press F12 to open developer tools and see console, you'll find logs there)
for radio and checkbox inputs you have change event, it triggers when user check and uncheck the box. bare in mind that you need to have same name="friendly-name" attribute on radio buttons in order them to work as expected.
for the "text" filed use input event.
don't add inline events in HTML, it's bad practice, add them via JS. from JS you can select all your inputs by ther class, name, tag name etc.. and add event handlers (you can find everything in the fiddle).
hope it helps. :D
I am working on a projected with typescript and Angular 2 and don't know how to continue on my application. I currently have a page with several radio buttons and have applied model-based forms to my page, and have successfully made all radio buttons mandatory with the <any>Validators.required functionality. I am able to display an error message if any set of radio buttons have no been selected yet
The next thing I need to do is to check that the correct radio buttons have been 'checked' throughout the page. Is this something I should do through validation? Solving this problem could be done in the "onSubmit" function that I call, but I would rather be able to display error messages on the fly, when they user is marking off the radio buttons to let them know they chose poorly.
Any help on this topic is greatly appreciated. I don't see any reason to upload any code snippets, but if you think you need it I can very quickly get something up.
My knowledge of JS is very limited and i need help in validating this form so its like the previous questionnaire they had which you can see on this URL
Is it best to use a jQuery plugin or Javascript? I'm trying to get it so when you select one checkbox per question you have a score appearing in bottom right hand corner and if you get the answer right the score increments by 1.
Probably the biggest thing I have done in JS so far. Any pointers or suggestions? Advice would be appreciated.
Current new form here.
I'd use jQuery or server side validation. Also, change your check boxes to groups of radio buttons, that way it's only possible to select one because of the way radio buttons work.
i've managed to sort this problem out - wrote an on click function and like created variables for the score and incremented this on click if the answer is correct which was then spanned in to a div that was setup.
Took ages to do but got there in the end :)
I need a simple form with radio buttons or pull downs, that returns a different message and link depending on the answer.
I don't want to save the data, but just to display based on the answer.
Is that we can do in JQuery..?
If anyone knows, please explain..
the code example on jquery's website for the change function is what you want, it registers a change handler, checks the value of the selected item, then changes the content of a div depending on your selection.
I have tried this for too long... too big for me. I need a little help here.
I have a page with products. each product got 3 sizes (normal, big, special)
The user is selecting radio button to choose the size and then hits the "add to cart".
I am trying to get the value he chose, but without any success. Right now I found that jQuery is almost working for me.
If i write this down:
selected_val = $("input[name='sizeof75']:checked").val();
I am getting to right value of group named sizeof75. But since it changes dynamically, i am looking for a way to migrate the field name into this. I mean something like this:
selected_val = $("input[name='"+field_name+"']:checked").val();
any help will be aprreciated.
Thank you
Sorry,
this question is not relevant... just had a syntax problem...