[Plugin: WP-Polls] Need help with adding Input Text field
-
Great job with this plugin Lester Chan,
I need help with the following.
Right now I am trying to create a poll using the poll templates with 2 input text fields, I need this for email harvesting from my users before voting, I will only need to asked them to fill Name and E-mail. Using the poll template below and added into wp template option<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p><div id="polls-%POLL_ID%-ans" class="wp-polls-ans"><ul class="wp-polls-ul"> <label for="name" id="name_label">Name</label> <input type="text" name="name" id="name" size="30" value="" class="text-input" /> <label for="email" id="email_label">Return Email</label> <input type="text" name="email" id="email" size="30" value="" class="text-input" />
Sadly, tweaking the polls-js.js and jquery to read the #name and #email IDs are not working.
I declared the variable and everything, tried using ajax to send the values to the php without success.var dataString = 'name='+ name; jQuery.ajax({ type: 'POST', url: pollsL10n.ajax_url, data: dataString, cache:false, success: poll_process_success});
on WP-POLL.PHP
$name = $_POST["name"]; $email = $_POST["email"];
altered the database to include the name and email field, which works.
$wpdb->query("INSERT INTO $wpdb->pollsip VALUES (0, $poll_id, $polla_aid, '$pollip_ip', '$pollip_host', '$pollip_timestamp', '$pollip_user', '$name', '$email', $pollip_userid)");
However it fails to retrieve the value of the input on the form, and on wp-polls.php it will not read the string. I really dont know what to do to make it work.
I areadly manage to add name and email columns in pollip database table.
which loops on every vote but it will not populate the name and email table.I am using a test wordpress install on my pc using xampp, and with only wp=polls available. the idea show look like this on the widget.
http://i48.tinypic.com/2ugc9s7.jpg
Thanks in Advance,
Krieg
- The topic ‘[Plugin: WP-Polls] Need help with adding Input Text field’ is closed to new replies.