Jump to content

php forum name help


SennNathan

Recommended Posts

I need to figure out how to give this input a name so when i submit it i can get the data from it.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css" type="text/css" rel="stylesheet"/>
<style>
input{font-size:1.3em;}
#log{position: absolute; top: 10px; right: 10px;}
span{color:blue; text-decoration: underline; cursor: pointer;}
</style>
</head>
<body>
<div id="inputs"></div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript"></script>
<script src="jquery.googleSuggest.js" type="text/javascript"></script>
<script>
$.each("web".split(" "), function(i, v){
  var div = $("<div>").appendTo("#inputs")
    , input = $("<input>").appendTo(div)
    , span = $("<label>").text(v).appendTo(div);
  input.googleSuggest({ service: v });
});
</script>
</body>
</html>
Link to comment
https://forums.phpfreaks.com/topic/292932-php-forum-name-help/
Share on other sites

This is what i have now but its still not working

<form name="SearchForm" method="get" action="index.php">
<script>

$.each("web".split(" "), function(i, v){
  var div = $("<div>").appendTo("#inputs")
    , input = $("<input name='whatevername'>").appendTo(div)
    , span = $("<label>").text(v).appendTo(div);
  input.googleSuggest({ service: v });
});
</script>
<input type="image" src="search.png" style="height:25px; width:25px">
</form>
Link to comment
https://forums.phpfreaks.com/topic/292932-php-forum-name-help/#findComment-1498772
Share on other sites

  On 12/6/2014 at 4:39 PM, SennNathan said:

 

This is what i have now but its still not working

<form name="SearchForm" method="get" action="index.php">
<script>

$.each("web".split(" "), function(i, v){
  var div = $("<div>").appendTo("#inputs")
    , input = $("<input name='whatevername'>").appendTo(div)
    , span = $("<label>").text(v).appendTo(div);
  input.googleSuggest({ service: v });
});
</script>
<input type="image" src="search.png" style="height:25px; width:25px">
</form>

 

Doesn't look like you're adding the input fields to the form? If you are, print the output of $_GET in your php script. It won't be in $_POST considering you're using GET as the form method.

Link to comment
https://forums.phpfreaks.com/topic/292932-php-forum-name-help/#findComment-1498774
Share on other sites

  On 12/6/2014 at 5:05 PM, SennNathan said:

Thats not working here is the link to where i have this http://yousearch.mobi/goog/

 

Don't understand what you're trying to achieve. There's an autocomplete on the input field, I get that. But you're not even adding the input fields to the <form> that you wanted to submit. So the data from the input fields will never reach whatever script the form is linked to.

 

Not sure where you're trying to submit either, since there's no submit button.

Link to comment
https://forums.phpfreaks.com/topic/292932-php-forum-name-help/#findComment-1498786
Share on other sites

This worked for what i needed

$.each("web".split(" "), function(i, v){
  var div = $("<div>").appendTo("#inputs")
    , input = $("<input name='keyword'>").appendTo(div)
    , input = input.appendTo('form')
    , span = $("<label>").text(v).appendTo(div);
  input.googleSuggest({ service: v });
});
Link to comment
https://forums.phpfreaks.com/topic/292932-php-forum-name-help/#findComment-1498792
Share on other sites

  On 12/6/2014 at 6:12 PM, Alex_ said:

 

 

..., since there's no submit button.

 

Alex, There is <input type='image'> which will submit the form when clicked, and also pass the x.y coordinates of where the image was clicked

Link to comment
https://forums.phpfreaks.com/topic/292932-php-forum-name-help/#findComment-1498793
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.