passing of parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rizzie
    New Member
    • Nov 2007
    • 10

    passing of parameters

    Hi,

    I need some help here.. I would like to pass parameters from 1 js file to another js file. My code works with IE browser unfortunately not in Firefox, why is that?

    Below are the sample codes:
    sample1.js
    [CODE=javascript]document.writel n('<input name="test" type="text" value="0" class="textfiel d" size="3"\/>');
    document.write( '<input name="Submit" type="image" src="'+img_path +'images\/btn_searchnow.g if" onClick="javasc ript:alert1(tes t.value);">');
    [/CODE]sample2.js
    [CODE=javascript]function sample(x){
    alert(x);
    }
    [/CODE]
    I have tried to enclosed the textbox to a form and pass form.test instead of test it works with mozilla but not in IE...

    Thanks in advance...=)
    Last edited by acoder; Apr 3 '08, 08:26 AM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Should alert1() be sample()?

    Try passing this.form.test. value.

    Comment

    Working...