Jump to content

php forum name help


SennNathan
Go to solution Solved by hansford,

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
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
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>

 

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
Share on other sites

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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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