Jump to content

trums

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

trums's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The submit button is just a normal submit button activation. The #rvspNoteSave in the above code is the code that the submit button activates. All it does is close the lightbox. I use firefox, but I will install firebug and see what it gives me.
  2. In this function I am attempting to grab the value of one of three radio buttons onclick. Then a lightbox is opened, inviting the user to add more information with a submit button. This works great until after you have gone through the process once. If you try to go through the process and 2nd time and click one of the radio buttons again, the submit button doesn't work! What can I do to make it work every time? The complete function is below: #rvspNoteSave is the submit button and I used the Boxy lightbox: http://onehackoranother.com/projects/jquery/boxy/ $("#rvspForm input:radio").click(function(){ var the_value = $(this).val(); new Boxy('<div style="margin:5px;">Leave an rsvp note<br/><textarea id="rvspNote"></textarea><br/><div class="span-4"></div><div class="span-4 last"><a href="#" id="noteClose">No, Thanks</a> <input type="button" id="rvspNoteSave" value="Save"/></div><hr class="space"/></div>', {title: "Add A Note", closeable: true, afterShow: function() { $("#rvspNoteSave").click(function(){ Boxy.get(this).hide(); }); }, afterHide: function() { $.ajax({ type: "POST", url: "http://localhost/events/ajax_savervsp/", data: "eventId="+eventId+"&note="+$("#rvspNote").val()+"&rvsp="+the_value, beforeSend:function() { $("#yourrvsp").html("<center><img src='http://p3.localhost:81/static/images/loader.gif'></center>"); }, success: function(data) { $("#yourrvsp").html("<center><br/><b>Your RVSP:</b> "+data+"</center>").show(); }, error: function() { alert("Connection to server interrupted. Please try again."); $("#yourrvsp").html(""); } }); }}); }); Your help is greatly appreciated.
  3. Whoops, sorry, I added up wrong. $numGuests should = 3. I'm splitting them so I can insert them into a database, recombining and echoing them is purely for testing. This is the only piece that is giving me problems.. but just in case here is the whole function: the name POST is full names separated by commas eg: Jane doe,Mark Smith,John Doe the email POST is email addresses separated by commas. $nameArray = explode(',', $this->input->POST('name',true)); $emailArray = explode(',', $this->input->POST('email',true)); $eventId = $this->input->POST('eventid',true); $ePid = $this->input->POST('ePid',true); $numGuests = $this->input->POST('guests',true); $i = 0; while($i <= $numGuests){ $splitName = preg_split("/ /", $nameArray[$i]; $data['stuff'] = $nameArray[0].' / '.$nameArray[1].'<br/>'.$splitName[0].' + '.$splitName[1]; $additional_data = array( 'first_name' => $splitName[0], 'last_name' => $splitName[1], 'email_rvsp' => "1", 'email_message' => "1", 'email_pic' => "1", 'email_invite_other' => "0", ); $id = $this->ion_auth->register(null, base64_decode($ePid), $emailArray[$i], $additional_data, 'EGuest'); $guestData = array('event_id' => $eventId, 'user_id' => $id); $this->db->insert('guests', $guestData); $i++; } Just in case I was confusing above, the problem I am encountering is that if I put $nameArray[$i]; into the preg_split() statement, it states that $splitName[1] does not exist and $splitName[0] is empty . However, if I put $nameArray[0]; it all works fine. I was originally using explode(), however it gives me the same problem Thanks for the help!
  4. Sure. Here is what I'm trying to input: // Name array is basically an array of full names. (not necessarily ending at 2) $nameArray = ( 0 => 'John Doe', 1 => 'Mary Jane', 2 => 'Bob Smith'); // $numGuests is the number of names in the $nameArray. For this instance, 2. $numGuests = 2; $i // Dummy var. I know I could just use a foreach loop instead of using a dummy var and a while loop, however I used a while because $i and $numGuests are used elsewhere in the while. ( I have only included the part that isn't working. This piece of code doesn't depend on anything that hasn't been included. )
  5. explode was what I was originally using, I have the same problem using that method as well.
  6. Hi guys, Here I have a first and last name separated by a space. I want to split the name up into first and last at the space. I tried writing the following, however it doesn't work with a variable in the index of $nameArray[]. Can anyone see how I can fix this, or suggest an alternative? thanks! $i = 0; while($i <= $numGuests){ $splitName = preg_split("/ /", $nameArray[$i]); echo $splitName[0].' '.$splitName[1]; $i++; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.