jQuery Impromptu version 2 has barely gotten its feet wet and it’s already leaps and bounds beyond version 1. We now have a fancy new theme which looks a lot more up to date. Also there has been an addition to the parameters available to submit and callback functions. The third parameter now available is a key/value object with the value of each named form field within the prompt at the time of the click. Now you can skip past having to search for the fields and get right to validating and submitting the data! Check out the video for more details!
Related posts:


3 Responses
trent
18|Feb|2009One quick note about the video, I pointed to the “for” attribute within the label tag as being the key within the form values object. The key is actually determined by the “name” attribute from the input, select, or textarea itself. This way multiple checkboxes all with the same name (id’s have to be unique) will give an array if there is more than one checked. Same with selects which allow multiple selections.
bootZ
21|Feb|2009Thought I’d share the problem I have found and the solution.
The ‘X’ close that is added was not getting as far as the callback, but failing so no unbinding and remove from the main window – so nothing was being restored and selectable. Found that callCallBack was populated, but should really be undefined so by also checking that a button has been clicked restores the window back to normality:
var removePrompt = function(callCallback, clicked, msg, formvals){
…..
if(callCallback && clicked) o.callback(clicked,msg,formvals);
This could be just me as I’m using images as per my other post and this happened in 1.8 version too.
Thanks again for the update – I can post my changes again for the images to be used, but haven’t got round to testing with multiple states as looking into FF problem of the prompt not scrolling with rest of page as contents of prompt is below the screen – works ok in IE(typical!!)
Николай
10|May|2009Спсибо, узнал много нового