FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

HTML submit textbox functions etc.

 


The-Master
Well this is difficult to explain but what I would like is an html page which would have many textbox options and one submit button. If information is put into the box then it will add it to the end of the url that the submit button will take you to. Basically
Code:
If textbox1=.... then:
To the end of the url add &image='textbox1.text'
and many more if possible.

This is to combine with php this is why I need the values after the url.

Thanks Very Happy
JayBee
You mean html <form> tag?

part of source of index.php
Code:
<form method=post>
<input name=field1>
<input name=field2>
<input name=field3>
<input name=field4>
<input name=field5>
<input type=submit>
</form>


after button click
it will generate url
Code:
index.php?field1=val1&field2=val2&field3=val3&field4=val4&field5=val5
The-Master
Thanks. But how do I get it so that once submit is clicked It actually directs you to url+form1+form2....

Do you just add a bit to the end of <input type=submit>

Like <input type=submit="www.www.php?'field1'&'field2'...>

Ta.
JayBee
I don't exactly know what you want

you want this?

BUTTON 1 (http://path.what.u/want?parameter1=value1)
Code:
<form action="http://path.what.u/want">
<input type=hidden name=parameter1 value=value1>
.
.
<input type=submit value="page one">
</form>



BUTTON 2 (http://path.what.u/want/next?parameter1=value2)
Code:
<form action="http://path.what.u/want/next">
<input type=hidden name=parameter1 value=value2>
.
<input type=submit value="page two">
</form>


BUTTON 3 (http://path.what.u/want/last?parameter1=value3)
Code:
<form action="http://path.what.u/want/last">
<input type=hidden name=parameter1 value=value3>
.
<input type=submit value="page three">
</form>
The-Master
What I want is something like this only have multiple textboxes that each value goes after the url.

so for example you input this
Code:

Textbox1 value=hello                     Textbox2 value=25                      Textbox3 value =url


The url would then be http://www.whatever.php?text=hello&size=25&image=url
JayBee
so add multiple texboxes

Code:
<form name="input" action="PHP/Uploaded%20Font%202.php?" method="get">

Type the Text you want to appear:
<input type="text" name="text" value="Mickey" size="20"><br>
Size:
<input type="text" name="size" value="25" size="20"><br>
Url:
<input type="text" name="image" value="someurl" size="20"><br>


<input type="submit" value="Submit">

</form>


or I still don't understand you
sonam
It is not too complicated how is looking in first moment. Create your form with any number of fields (with different names).

Code:
<form name="input" action="generator.php?" method="POST">
Type the Text you want to appear:
<input type="text" name="text" value="Mickey" size="20"><br>
Size:
<input type="text" name="size" value="25" size="20"><br>
Url:
<input type="text" name="image" value="someurl" size="20"><br>


<input type="submit" value="Submit">

</form>


Create generator.php like this one below:

Code:
<?php
$image = $_GET['image'];
$size = $_GET['size'];
$text= $_GET['text'];

// check if is image field empty and grab your image if is true
if(empty ($image)) {
$image = "http://www.your_site/your.jpg";
}

// here is possible to insert your part of php code

// redirect user on your php page
header("Location:http://www.www.your_site/your_php_page.php?tekst=$tekst&size=$size&image=$image");

?>



If you need all informations for procesing on your_php_page.php just use same GET instructions in your code like this in generator.php. Also you can insert your code in generator.php and generate all before redirect but I don't know how your script working. Then try.

Sonam
The-Master
OK thanks I don't know how I didn't work that out myself!! lol. How would I go aout making some radio buttons so that if one is selected then one thing goes after the url and if another is selected that goes after the url. Ta Smile
JayBee
http://w3schools.com/html/html_forms.asp

just google it Wink
or buy some book about HTML/xHTML/PHP for beginners
blueray
hi, did this help ?

Code:
function do_search()
{
   var elem = document.getElementById("t");
   var get_str = '';
   for (i = 0; i < elem.length; i++)
   {
      if ((elem[i].type == 'text') && (elem[i].value != ""))
      {
         get_str += (elem[i].name + '=' + elem[i].value);
         if (i < elem.length)
         {
            get_str += '&';
         }
      }
   }
   
   window.location.search = '?q=1000&' + get_str;
}

<form method="get" id="t">
<input type="text" name="text1" id="text1" /><br />
<input type="text" name="text2" id="text1" /><br />
<input type="text" name="text3" id="text1" /><br />
<input type="button" name="search" onclick="do_search();" /><br />
</form>
alkutob
Nice discussion with good informations.

thank you all , I really found some useful things I was searching to know

about
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.