...

View Full Version : Joining Input Fields



Donno24
07-16-2008, 11:01 AM
Hi Everyone,

Im trying to add input fields within the URL.

What im trying to do is get the user to enter information and then choose an extension from a list. When they submit the form, I want the Extension to be joined to the input field which the user has entered the information.

Example:

User Enters:
Donno24
Selects From Dropdown:
.com

When submit is entered I want the URL to be
domain=Donno24.com
Not
domain=Donno24&extension=.com

Hope you can help,
Donno24

abduraooft
07-16-2008, 11:07 AM
You'd need to depend on some javascript for this. Say, in the onsubmit event of form, execute a javascript code like

window.location="http://yourdomain.com?domain="+yourform.element1.value+yourform.element2.value;

Donno24
07-16-2008, 11:17 AM
Sorry im no good at javascript, here is my form code, can you explain a bit more..



<form action="mod.php" method="get" onsubmit="return formCheck(this);" name="whois">
<input name="mod" type="hidden" size="20" maxlength="150" value="orders" />

<input name="ord_domain" type="text" size="20" maxlength="150" />
<select name="extension">
<option>.ie</option>
<option>.com</option>
<option>.eu</option>
<option>.net</option>
<option>.info</option>
<option>all</option>
</select>


<input name="Submit" type="submit" value="Proceed" />
<br />(<span class="style1">YourDomain.ie / com / co.uk</span>)
</form>



This is the javascipt:

window.location="http://MYWEBSITE.com/bills/mod.php?mod=orders&ord_domain="+whois.ord_domain.value+whois.extension.value;

abduraooft
07-16-2008, 11:24 AM
At the end of your formCheck() function, after all validations, have a try by adding

var domain=document.whois.ord_domain.value;
var tld=document.whois.extension.value;

window.location=http://MYWEBSITE.com/bills/module.php?mod=orders&domain=domain+tld
But this won't work if javascript is disabled, so you need to have two set of codes to receive the values in the next page.

Donno24
07-16-2008, 11:35 AM
Thank You, I got it working okay!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum