[Hidden-tech] capturing jquery multiple slider data in a form submit?

Jenny Katz Brandoli jennykatzbrandoli at gmail.com
Wed Oct 24 23:27:03 EDT 2012


Thanks so much, Gyepi and Bruce. I thought input fields were the way to go, but I didn't know which part of the javascript to call. The function (which I cut and pasted from someone else who knew something) looks like this:

*****

$(function(){
	
	var currentValue = $('#currentValue');
	
	$("#slider1,#slider2,#slider3,#slider4,#slider5").slider({ 
		range: "min",
		value:37,
		min:1,
		max: 500,
		slide: function(event, ui) {
			currentValue.html(ui.value);
		}
	});
	
});

******

How do I name the five input types?

<input type="hidden" name="slider1" value="ui.value">???

What does "value" have to equal? 



I have used PHP a bit, hacking around in Wordpress. But I'm really a noob at all of it.

Thanks again, both of you!

(And thanks, too, Naaz, for the nice words!)

all the best,
Jenny


On Oct 24, 2012, at 6:31 PM, Bruce Hooke <bghooke at att.net> wrote:

> Hi Jenny,
> 
> Following up on what Gyepi said, I was also going to suggest creating hidden
> form fields that would hold the values from the slider. I would have a
> JavaScript event that runs when a slider position is changed and then have
> JavaScript code that updates the value in the hidden field for that slider.
> jQuery may have built in methods for doing this. I am more familiar with
> doing this sort of thing outside of jQuery.
> 
> On emailing the form data, there are pre-built email modules that will
> basically dump the form data into an email and send it to you. The results
> tend to be pretty "raw," meaning the email is not real pretty, but the data
> come through. formmail.pl is one example that is often available on shared
> hosting servers. The "action" for the form would be something like
> "/cgi-sys/formmail.pl". Check with your hosting company to find out if they
> have formmail available and if so what the path to it is. Most likely the
> email will need to be sent to an address that is associated with your
> website (e.g., me at yayforeverything.com). This is a security measure to keep
> formmail from being used to relay spam.
> 
> The more elegant solution is to use something like php to receive the form
> submission, validate it and then put it into an email. This gives you full
> control over the look of the email and over who it is sent to, but it means
> learning php. It also gives you much more control over what the user sees
> after they submit the form. It also allows you to validate the form data
> before it gets sent to you, filtering out blank forms and the like. You do
> need to be careful when you get into php because it is possible from someone
> to use a poorly written php form submission system to harm your website.
> 
> Regards,
> Bruce Hooke
> B.G.Hooke Consulting
> 401-421-3634
> 
> -----Original Message-----
> From: hidden-discuss-bounces at lists.hidden-tech.net
> [mailto:hidden-discuss-bounces at lists.hidden-tech.net] On Behalf Of Gyepi SAM
> Sent: Wednesday, October 24, 2012 2:26 PM
> To: Jenny Katz Brandoli
> Cc: hidden-discuss at lists.hidden-tech.net
> Subject: Re: [Hidden-tech] capturing jquery multiple slider data in a form
> submit?
> 
>   ** Be sure to fill out the survey/skills inventory in the member's area.
>   ** If you did, we all thank you.
> 
> 
> Hi Jenny,
> 
> Forms looks nice!
> 
> In order to capture the slider data, you need to add hidden input types to
> the form, one for each slider. Then, when the slider value changes, you set
> the value of the associated hidden input to the slider value. When the form
> is submitted, the values of the hidden inputs, because they are input types,
> will be submitted. If you change your form action from a mailto to a script
> url, the form will be submitted to the script. Of course, you'll need a
> script on the server to handle the input. It's possible to change the
> process a bit with javascript but you'll ultimately need something on the
> server side to receive and process the data. You can store the data in a
> database, email it to yourself, show it to the user, all of the above, etc,
> etc.
> 
> -Gyepi
> 
> On Wed, Oct 24, 2012 at 05:38:38AM -0400, Jenny Katz Brandoli wrote:
>>   ** Be sure to fill out the survey/skills inventory in the member's
> area.
>>   ** If you did, we all thank you.
>> 
>> 
> 
>> Hi all-
>> 
>> I'm a noob, trying hard to create myself a website using html and css.
> I've managed to create a contact/submission form with multiple sliders that
> looks nice, but I don't know how to capture the slider data in a form
> submit. In fact, I don't even know the best way to submit the form (to
> myself). I can create a regular html mailto: form action, but I would rather
> have the site just send the form data to me, rather than take users into an
> email program. 
>> 
>> The form can be seen here:
>> 
>> http://www.yayforeverything.com/deadlinedom/slider/form.html
>> 
>> Any and all help is greatly appreciated. I'm vastly ignorant, but I'm
> learning fast!
>> 
>> Thanks,
>> Jenny
> 
>> _______________________________________________
>> Hidden-discuss mailing list - home page: http://www.hidden-tech.net 
>> Hidden-discuss at lists.hidden-tech.net
>> 
>> You are receiving this because you are on the Hidden-Tech Discussion list.
>> If you would like to change your list preferences, Go to the Members   
>> page on the Hidden Tech Web site.
>> http://www.hidden-tech.net/members
> _______________________________________________
> Hidden-discuss mailing list - home page: http://www.hidden-tech.net
> Hidden-discuss at lists.hidden-tech.net
> 
> You are receiving this because you are on the Hidden-Tech Discussion list.
> If you would like to change your list preferences, Go to the Members   
> page on the Hidden Tech Web site.
> http://www.hidden-tech.net/members
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.2221 / Virus Database: 2441/5351 - Release Date: 10/24/12
> 



Google

More information about the Hidden-discuss mailing list