I have an accordion that I want to create the tabs from a database loop. so each will have a unique id. when a tab is opened with the id, i want a call to the database to load appropriate data from the database and populate the accordion.
I have a database with questions and for each question, a list of answers i created a db table that for any question dependant on the chosen answer it would hide the next x questions. Sothat the user doesnt have to fill the unnecessary questions. any answers how to make it easier and manageable. Iuse tables and rows and td's with id's on the tr's
$("#demoForm .step").each(function(){ // for each step in the wizard, add an option to the remoteAjax object... var thisId = $(this).attr("id"); remoteAjax[$(this).attr("id")] = { url : "store.asp", // the url which stores the stuff in db for each step dataType : 'json', beforeSubmit: function(data){ var nPercent = Math.round((thisId / noOfSteps)*100); var nColumn = 100 - nPercent;
$("#data").html("<table width=760 class='Progress' cellspacing=3><tr><td style='background-color:#000000; color:#ffffff;height:30px;' align=center width="+nPercent+"%'>" + nPercent + "</td><td width='+nColumn+'%' style='background-color:#FFFFFF;'></td></tr></table>" + nPercent + ' ' + nColumn + ' ' + $.param(data)) }, success : function(responseText, statusText, xhr, $form){ return data; //return true to make the wizard move to the next step, false will cause the wizard to stay on the CV step (change this in store_in_database.html) } }; });
Ive implemented the Form Wizard using Ajax. In the example it displays the posted data in a div. How can I display a progress bar there instead?
If I know how many Steps there and I know the id of the current step, can I call a simple piece of ASP using a table to create a progress bar OR is there one built in to the FormWizard?
I have the following code, but I can seem to get the values on the page it posts to (store.asp).; simply by doing a request.querystring. What am i doing wrong?
$(function(){ $("#demoForm").formwizard({ formPluginEnabled: true, validationEnabled: true, focusFirstInput : true, formOptions :{ success: function(data){$("#status").fadeTo(500,1,function(){ $(this).html("You are now registered!").fadeTo(5000, 0); })}, beforeSubmit: function(data){$("#data").html("data sent to the server: " + $.param(data));}, dataType: 'json', resetForm: true } } );
var remoteAjax = {}; // empty options object
$("#demoForm .step").each(function(){ // for each step in the wizard, add an option to the remoteAjax object... remoteAjax[$(this).attr("id")] = { url : "store.asp", // the url which stores the stuff in db for each step dataType : 'json', beforeSubmit: function(data){ alert($.param(data)); $("#data").html("data sent to the server: " + $.param(data)) }, success : function(responseText, statusText, xhr, $form){
alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.');
return data; //return true to make the wizard move to the next step, false will cause the wizard to stay on the CV step (change this in store_in_database.html) } }; });
$("#demoForm").formwizard("option", "remoteAjax", remoteAjax); // set the remoteAjax option for the wizard
I have a table with : Time, CAB, New, Follow Up, Reserved, Urgent radio buttons
Plus a javascript function + - that Adds / Removes a new row to the table with an incremented Counter (see below)
How can I code the page so that if you click on CAB it opens up a popup and the options you select are placed into a hidden field on the page (with the Counter as the id BUT only for the first time you select CAB.
I can get it to work IF its the first option (because this is hard coded in the html, but not for subsequent ones.
OR is there a good jQuery way of doing this.
I realise I may have been vague, so please ask me for furter informationa and i'll endeavour to explain more clearly.
I have the above. What I need, is if you click on the first radio, 2,3,4 are replaced with a select box with the same index id (a incremental number added to the text and radio boxes. everytime one is added it is called with a new index). And a reset button to put the original radio buttons back.
There will be a few rows of these each with a different id,
I have a table with my rows in it and a row contains 3 td's with radio button's in them (im open for a redesign idea).
When i validate i get 'big' red boxes around each radio button and the text goes below and 'This field is required' appearing after the first radio button. ( bec i havnt got any validation on the page for it)
How do i create validation just for these and put some error msg somewhere appropriate?
I have a long form and I have setup some validation but I'd like some help tidyuing it up and enhancing my requirements. The following displays an error message but its messy. I'd like to know how
a) Highlight the whole row
b) Put an asterix at the end of the appropriate item.
c) Any other techniques you think good.
Also can you explain to me why, when its validated the Address fields go out of alignment with the other text fields.
If possible could you tell me how to (in realtime using ajax) check (for example) if the NHS No exists in one of my databases. If not display an error message and not allow the form to be submitted.
I have trawled the internet for the answer but I cant find the right answer.
One last thing: If I have a datepicker field, Ive noticed that you cant edit the field directly! Any opinions?
Can anyone please point me in the right direction for the various methods of validation.
Currently I have a form that I validate using Javascript (see below). what I need is when the user submits if a field isnt entered then the whole row is highlighted
ALSO
An asterix placed inline at the end of the row (all in line with other rows)
label.error { /* remove the next line when you have trouble in IE6 with labels in list */ color: red; font-style: italic; } div.error { background-color:#F3E6E6; border-color: #000000; border-style: solid solid solid none; border-width: 12px; padding: 5px;
Sorry if this long winded. Im struggling to find examples to help me do various methods of validation.
I'm using tables and not CSS (so no labels)
I have the code below and I would really lik eto know how I can validate it in various ways eg: highlight the whole line put an asterix at the beginning /end of the error line. Summary and Warning
Plus say I have 3 boxes for dob how can i validate the whole as a date and give one error (as above).
Ive meanaged to create a modal ajax popup but it hardcodes to a html file. Casn I get it to pass a parameter of the current object id to the modal and send it to an asp page with the parameter?
I have 3 elements on the same row (below) but I end up with 3 error messages on the same line, which is crap. Is there a way of creating a date and checking its validity and displaying ONE error message?
I would like it to validate the text box (and display an error msg with the rest of the validation) for being empty IF the user selects Other from the dropdown. Also it would be nice if the text box for the Other was hidden until the user selects Other from the dropdown.
I am using the usual jquery rules and messages, but i have no idea how to do this.
I downloaded the code below to allow the user to add another form element if required. It works BUT it places the text from the previous text box into the new one.
I want to create an email page where the user can create as many recipents as possible, but this isnt acceptable. How do i modify the code to remove the clone and just create a new form element?
Cheers
Darryl
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#btnAdd').click(function() { var num = $('.clonedInput').length; var newNum = new Number(num + 1); var newElem = $('#input' + num).clone().attr('id', 'input' + newNum); newElem.children(':first').attr('id', 'name' + newNum).attr('name', 'name' + newNum); $('#input' + num).after(newElem); $('#input' + num).html=''; $('#btnDel').attr('disabled',''); //if (newNum == 5) // $('#btnAdd').attr('disabled','disabled'); }); $('#btnDel').click(function() { var num = $('.clonedInput').length; $('#input' + num).remove(); $('#btnAdd').attr('disabled',''); if (num-1 == 1) $('#btnDel').attr('disabled','disabled'); }); $('#btnDel').attr('disabled','disabled'); }); </script> </head> <body> <form id="myForm"> <div id="input1" style="margin-bottom:4px;" class="clonedInput">Name: <input type="text" name="name1" id="name1" /></div> <div> <input type="button" id="btnAdd" value="add another name" /> <input type="button" id="btnDel" value="remove name" /> </div> </form> </body>