EDIT: I am using Code Igniter: http://www.codeigniter.com
So I’m new to web developement and programming in general and I’ve been playing around with PHP and started developing a little website and i want to make it easier for users to submit.
I have 9 radio buttons (oh and I’m using code igniter)
<?php
echo form_radio('name1', '3')." 3 ";
echo form_radio('name1', '2')." 2 ";
echo form_radio('name1', '1')." 1 ";
echo form_radio('name2', '3')." 3 ";
echo form_radio('name2', '2')." 2 ";
echo form_radio('name2', '1')." 1 ";
echo form_radio('name3', '3')." 3 ";
echo form_radio('name3', '2')." 2 ";
echo form_radio('name3', '1')." 1 ";
$submit = Array ("name" => 'submit', "value" => 'Submit', "class" => "g-button large");
echo form_submit($submit);
echo form_close();
?>
So i want something to check for duplicates and display an error (preferable a div) without reloading the page and i would also like the form to submit without the submit button (for example hotornot.com but with 3 sets of radio buttons).
I understand this needs jQuery and possibly AJAX (?) and i’m completely clueless with them both. And also i saw this: http://jquery.malsup.com/form/ and i tried tinkering with it but i had nfi what i was doing.
You don’t need to use every helper in CI; I wouldn’t use form helper, at least for the radio buttons as you’ll need to include onClick event handler into radio button html code:
this part should be put between tags in your html code, above radio buttons of course:
the last one includes jQuery code of course and you sould include it too:
I hope that this code snippets give you more than basic idea where your coding should go for this case.