/    Sign up×
Community /Pin to ProfileBookmark

putting a value from a popup into a form

PostPosted: Thu Jul 20, 2006 4:26 am Post subject: putting a value from a popup into a php form Reply with quote Edit/Delete this post
Hi

I have set up an online form for publishing a news item.

The form allows users to asssociate an image to the news article. These images are already uploaded into a directory of the site.

I have created a pop up box that lists all images in this directory and allows the user to preview them. However what I want to do is for the user to click on the images link on the popup and its value be added to a textfield on my form.

Is this possible with javascript. If so how would I go about achieving this?

Thanks very much i advance

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@LeeUJul 20.2006 — Here are a few you can adapt to your circumstances:

  • * [URL=http://javascript.internet.com/forms/field-explanation.html]One[/URL]

  • * [URL=http://javascript.internet.com/forms/items-popup-list.html]Two[/URL]

  • * [URL=http://javascript.internet.com/forms/popup-picker.html]Three[/URL]
  • Copy linkTweet thisAlerts:
    @hame23authorJul 20.2006 — thats a great hep thankyou

    These examples show how to transfer a value from a select menu across how could this be achieved when using radio buttons

    I have tried using the function as below where file is the name of my group of radio buttons

    <input type="submit" value="Item Select Item" onClick="sendValue(this.form.file.defaultChecked);">

    function sendValue(s){

    alert(s);

    var selvalue = s.options[s.defaultChecked].value;

    alert(selvalue);

    window.opener.document.popupform.choice.value = selvalue;

    window.close();

    }

    but this has not worked, can you see what I am doing wrong?

    Thanks inadvance
    ×

    Success!

    Help @hame23 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...