Nov 21, 2009

Populating A Form From A Link

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > HTML, XML etc..

Populating A Form From A Link

kvarnerexpress
I have an online application Form that multiple groups use from their own webpages. I would like the form to automatically populate a couple fields depending on which group's site it's clicked from......... I think there is a way to populate a form just by adding stuff to the link, but I don't know how and I can't find any information on how online (not really sure what to search)......... anyone know? I want a combo-box and a text field automatically populated with information depending on the link that's clicked.

I honestly don't know if this is an HTML thing or a Javascript thing... if need be I'll go ask on the Javascript forum instead.

Thanks!

Comment/Reply (w/o sign-up)

Tyssen
It sounds like you're talking about using the querystring to pass variables to your form. So your link would be something like link.php?id=X&somevalue=Y&someothervalue=Z.
Then you use $_GET or $_REQUEST to access the variables and then print them to your form.

Comment/Reply (w/o sign-up)

omar
I was searching for something similar...i need some help[ as well..Tyseen i dont get what you mean? The page my form is on a HTML file not a php..and yeah i donjt understand what you mean

Comment/Reply (w/o sign-up)

pawitp
That's going to be a javascript work, but I reccommend PHP more. Trap17 supports PHP why not use it? It's not that hard to work with PHP, you'll end up using PHP to process the form anyway. So why not using php for the form.

Another thing is you said from a "link". Different links can point to different pages can't it, so why combine it to the same page?

Comment/Reply (w/o sign-up)

Tyssen
You can't achieve this sort of thing without some sort of scripting whether it be PHP, ASP or javascript (not as straightforward in JS anyway I think). Your form will be output to the browser as HTML, but you can use a script to construct that HTML and fill in the values.
So, taking the previous example, the link to the form is link.php?id=X&somevalue=Y&someothervalue=Z.
Using PHP, you'd do something like this:

CODE
<?php print '<input type="text" name"field1" id="field1" value="'.$_GET('somevalue').'" />
print '<input type="text" name"field2" id="field2" value="'.$_GET('someothervalue').'" /> ?>

Comment/Reply (w/o sign-up)

Lozbo
I think what you want is that if you select an option in the very form, like a select, other stuff beneath it will get some info, i have something like that... let me get it:

HTML
<select name="acompa" id="acompa" onchange="if(acompa.selectedIndex==1)nombre_acompa.disabled=false; else{nombre_acompa.disabled=true; nombre_acompa.selectedIndex=0}">
<option value="0">-----</option>
<option value="1">yes</option>
<option value="2">no</option>
</select>

Where nombre_acompa is the field that you want to block, or unblock.

I know that you want to actually populate the fields, not block them or unblock them, but you can use this principle and apply this:

document.form.nombre_acompa.value == "text to be set"

In the 'onchange' javascript event.

This would not be valid xhtml 1.0 strict though. (I think there's no "onchange" attribute =P )

 

 

 


Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Populating Link

  1. Making A Refresh Link On Your Website. - refresh local webpage (17)
    /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> post it on ur website
    CODE refresh It can refresh local webpage. U can add it at ur forum so that each topic u
    are reading can be refresh easily. If ur website return to homepage after pressing I.E. refresh
    button, then u must need this coding. /cool.gif' border='0' style='vertical-align:middle'
    alt='cool.gif' /> Beacus visitors only want to refresh local webpage but not go back to homepage.
    /ohmy.gif' border='0' style='vertical-align:middle' alt='ohmy.gif' /> * same co...
  2. Link To Create Desktop Shortcut? - (7)
    Is there a way to make a link that actually creates a desktop shortcut? I have a page that gives
    links to files on our intranet but I know of people who try and make shortcuts for these files. It
    would be nice if I could put a link next to the link for the file that would make a shortcut. Use
    a more descriptive topic title next time. ...
  3. Table/cell Link? - (11)
    Well, I actually don't know what it is. But I need a code where you can click everywhere on the
    table, not only on the text/image....
  4. Creating Link In Html - Help Me With This! - (5)
  5. Refresh Main Window By Clicking Link In Popup? - (2)
    This is another refresh problem question. The project I'm doing uses tons of frames (I know,
    some of you will probably advise me not to use frames) and I'm having problems with refreshing
    the target frames. The problem is, I have a main page (main.html) that is a popup (so that I
    don't see the address bar and the other toolbar bits in my browser) and there are links in that
    page that when clicked also pops up a page. What I don't know is how to refresh the main page
    using a link in the other popup page. I've tried using this but this only works f...
  6. Dropdown Menus Links - IDK how to make them link (3)
    Ok its a big problem to me, i need to make my drop down menus options link to a web page. I know i
    can do it with a button, and i can get that to work but i need/want to have it link as soon as the
    option is selected........How do i do that?...
  7. Link Colour - (5)
    Hey all, i dont know how easy this is to do or whether it can be done just using HTML or whatever.
    Basically i have 2 seperate navigation bars top nav bar is the parent navigation bar. when you
    hover over any of the entries in this parent bar it dynamically updates the second nav bar. what i
    ideally want is to highlight the parent link in black when i move the mouse over it BUT stay black
    until i select/ hover over another parent link. does that make sense? ...
  8. A Good Space For Learn Html - web site link (5)
    Hi i find this web site you can learn html lan very fast and very easy woow i found it many
    tutorials go http://www.w3schools.com/ its really good website /rolleyes.gif' border='0'
    style='vertical-align:middle' alt='rolleyes.gif' /> ...
  9. Expanding Link - (12)
    Wee... Another question: How can I make that clicking on a specific link expand to something?
    Well... Here's an example: I have a list with the 5 best sites: Site 1 {more info} site 2 {more
    info} etc. Clicking on {more info} for site 1, will show a description below the link, and now, site
    2 will be below the description. I hope you understand my question /tongue.gif' border='0'
    style='vertical-align:middle' alt='tongue.gif' /> ...
  10. Fade Link Color - (4)
    hi, how do you make the linkcolor fade to another color when pointing your cursor to the link?
    It's a rather short description of my question, but i hope it's clear /cool.gif'
    border='0' style='vertical-align:middle' alt='cool.gif' /> . More tips and tricks are welcome......



Looking for populating, form, link

Searching Video's for populating, form, link
See Also,
advertisement


Populating A Form From A Link

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com