Jump to content

Post multiple text inputs


Minklet

Recommended Posts

I am using a load and insert ajax query, which is here:http://www.9lessons.info/2009/05/insert-and-load-record-using-jquery-and.html

 

Which works nicely, but I can't get it to work for multiple text inputs. I have scoured google for about 10hours and can't find something simple. I'd consider myself fairly good at figuring things out, but Ajax seems to have about a hundred different ways of doing the exact same thing and none of which I can see how to implement.

 

This is what I have:

var element = $(this);
   
    var promoter = $("#promoter").val();
    var venue = $("#venue").val();
    var eventlink = $("#eventlink").val();
    var date = $("#date").val();

    var dataString = 'content='+ promoter'&venue='+ venue'&eventlink='+ eventlink'&date='+ date';

 

 

 

$.ajax({
	type: "GET",
  url: "demo_insert.php",
   data: dataString,
  cache: false,
  success: function(html){
  

 

 

and the html:

 

<form  method="post" name="form" action="">
<table cellpadding="0" cellspacing="0" width="500px">

<tr><td align="left"><div align="left"><h3>What are you doing?</h3></div></td></tr>
<tr>
<td style="padding:4px; padding-left:10px;" class="comment_box">
<input type="text" style="width:40px;font-size:14px; font-weight:bold" name="promoter" id="promoter" maxlength="15" />
<input type="text" style="width:40px;font-size:14px; font-weight:bold" name="venue" id="venue" maxlength="15" />
<input type="text" style="width:40px;font-size:14px; font-weight:bold" name="date" id="date" maxlength="15" />
<input type="text" style="width:40px;font-size:14px; font-weight:bold" name="eventlink" id="eventlink" maxlength="15" />
<input type="submit"  value="Update"  id="v" name="submit" class="comment_button" />
</td>

</tr>

</table>
</form>

 

 

I'm getting a 'missing ; before statement' error in firebug pointing to my datastring variable.

 

 

This is driving me insane, if I could actually find some solid answers on google rather than a constant stream of contradictory examples I would be set. Any help please?

 

Link to comment
https://forums.phpfreaks.com/topic/210225-post-multiple-text-inputs/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.