RE: javascript question...
try var newwin=window.open("a.html?Name="+namVal); -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:37 PM To: [EMAIL PROTECTED] Subject: javascript question... Hi... Is it possible to send a value of a form element from the parent window to the child window like this??? function go() { var namVal = document.fm1.txtName.value; var newwin=window.open("a.html?Name=namVal"); } The above does not work... it will give me 'namVal' as the value rather than the actual typed in value when I try to get request.getParameter How can I achieve this functionality??? I need to pass a form element value when opening a new window. This value is essential at this point coz I perform an action based on this value and then bring the pop up page Suggestions requested please... Thanks! Jacob - Do you Yahoo!? Exclusive Video Premiere - Britney Spears - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: javascript question...
Thanks Narayanan -- I tried this b4, but this will throw an error... Actually, you need to pass a total string into the open method Prashanth Narayanan <[EMAIL PROTECTED]> wrote:try var newwin=window.open("a.html?Name="+namVal); -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:37 PM To: [EMAIL PROTECTED] Subject: javascript question... Hi... Is it possible to send a value of a form element from the parent window to the child window like this??? function go() { var namVal = document.fm1.txtName.value; var newwin=window.open("a.html?Name=namVal"); } [input] [input] The above does not work... it will give me 'namVal' as the value rather than the actual typed in value when I try to get request.getParameter How can I achieve this functionality??? I need to pass a form element value when opening a new window. This value is essential at this point coz I perform an action based on this value and then bring the pop up page Suggestions requested please... Thanks! Jacob - Do you Yahoo!? Exclusive Video Premiere - Britney Spears - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Exclusive Video Premiere - Britney Spears
RE: javascript question...
actually you can - just not the way i said it though ... sorry try this ... function go() { var namVal = document.fm1.txtName.value; var newWinStr = 'a.html?Name='+namVal; var newwin=window.open(newWinStr); } -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:44 PM To: Struts Users Mailing List Subject: RE: javascript question... Thanks Narayanan -- I tried this b4, but this will throw an error... Actually, you need to pass a total string into the open method Prashanth Narayanan <[EMAIL PROTECTED]> wrote:try var newwin=window.open("a.html?Name="+namVal); -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:37 PM To: [EMAIL PROTECTED] Subject: javascript question... Hi... Is it possible to send a value of a form element from the parent window to the child window like this??? function go() { var namVal = document.fm1.txtName.value; var newwin=window.open("a.html?Name=namVal"); } [input] [input] The above does not work... it will give me 'namVal' as the value rather than the actual typed in value when I try to get request.getParameter How can I achieve this functionality??? I need to pass a form element value when opening a new window. This value is essential at this point coz I perform an action based on this value and then bring the pop up page Suggestions requested please... Thanks! Jacob - Do you Yahoo!? Exclusive Video Premiere - Britney Spears - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Exclusive Video Premiere - Britney Spears - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: javascript question...
Try this function go() { var namVal = document.fm1.txtName.value; var newwin=window.open("a.html?Name="+namVal); } Thanks Nazeer -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:37 PM To: [EMAIL PROTECTED] Subject: javascript question... Hi... Is it possible to send a value of a form element from the parent window to the child window like this??? function go() { var namVal = document.fm1.txtName.value; var newwin=window.open("a.html?Name=namVal"); } The above does not work... it will give me 'namVal' as the value rather than the actual typed in value when I try to get request.getParameter How can I achieve this functionality??? I need to pass a form element value when opening a new window. This value is essential at this point coz I perform an action based on this value and then bring the pop up page Suggestions requested please... Thanks! Jacob - Do you Yahoo!? Exclusive Video Premiere - Britney Spears - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Javascript question...
Jacob, Why are you doing this in JavaScript to begin with? Why don't you use the struts html tags to display the select boxes and populate the options lists from collections. You can then set attributes in your form bean and have these fields be defaulted automatically. -Richard -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 4:06 PM To: [EMAIL PROTECTED] Subject: Javascript question... Hi Folks... One more javascript question... I have a page that consists of date fields as select boxes... say optionDay, optionMonth, optionYear... I fill the selectboxes calling a javascript function... Now if I have values of day, month, year executing an action. How can I default those values in the select box??? I mean how can I make that particular option 'selected'??? I know we can do that by calling a funtion on the load event... But, I don't want to do it that way as my body tag is generic across all pages... I am trying something like this... function generateYear(optionName,defaultValue) { var s = document.forms[0].elements[optionName]; var today = new Date(); var year = today.getYear(); document.write(''); } function generateDay(optionName,defaultValue){ document.write(''); } function generateMonth(optionName,defaultValue){ document.write(''); } and in my html... I say generateMonth("optStartDtMonth",12); generateDay("optStartDtDay",05); generateYear("optStartDtYear",2000); I want to make 12, 05, 2000 selected on the load of the page... how do I do that??? I am trying doing something like this... var s = document.forms[0].elements[optionName]; if ( s.options[i].value == defaultValue) { s.options[i].selected = true; } On the click of some thing it works -- if I put the code in the generate year or month or day, if fails to recognize the form element!!! Any suggestions appreciated... Thanks in advance... -Jacob - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Javascript question...
unfortunately we aren't using Struts here... This is an requirement that comes across all pages -- thinking of making it more generic and Im trying this... "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]> wrote:Jacob, Why are you doing this in JavaScript to begin with? Why don't you use the struts html tags to display the select boxes and populate the options lists from collections. You can then set attributes in your form bean and have these fields be defaulted automatically. -Richard -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 4:06 PM To: [EMAIL PROTECTED] Subject: Javascript question... Hi Folks... One more javascript question... I have a page that consists of date fields as select boxes... say optionDay, optionMonth, optionYear... I fill the selectboxes calling a javascript function... Now if I have values of day, month, year executing an action. How can I default those values in the select box??? I mean how can I make that particular option 'selected'??? I know we can do that by calling a funtion on the load event... But, I don't want to do it that way as my body tag is generic across all pages... I am trying something like this... function generateYear(optionName,defaultValue) { var s = document.forms[0].elements[optionName]; var today = new Date(); var year = today.getYear(); document.write(''); document.write('Year'); for (var i=(year-4);i document.write('' + i+''); } document.write(''); } function generateDay(optionName,defaultValue){ document.write(''); document.write('Day'); for (var i=1;i document.write('' + i+''); } document.write(''); } function generateMonth(optionName,defaultValue){ document.write(''); document.write('Mon'); document.write('Jan'); document.write('Feb'); document.write('Mar'); document.write('Apr'); document.write('May'); document.write('Jun'); document.write('Jul'); document.write('Aug'); document.write('Sep'); document.write('Oct'); document.write('Nov'); document.write('Dec'); document.write(''); } and in my html... I say generateMonth("optStartDtMonth",12); generateDay("optStartDtDay",05); generateYear("optStartDtYear",2000); I want to make 12, 05, 2000 selected on the load of the page... how do I do that??? I am trying doing something like this... var s = document.forms[0].elements[optionName]; if ( s.options[i].value == defaultValue) { s.options[i].selected = true; } On the click of some thing it works -- if I put the code in the generate year or month or day, if fails to recognize the form element!!! Any suggestions appreciated... Thanks in advance... -Jacob - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
RE: Javascript question...
Jacob, You wrote: "unfortunately we aren't using Struts here..."? If you aren't using Struts then a) why are you asking this question on a Struts mailing list b) What do you mean then when you write "Now if I have values of day, month, year executing an action. How can I default those values in the select box???" Regards, Richard -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 4:44 PM To: Struts Users Mailing List Subject: RE: Javascript question... unfortunately we aren't using Struts here... This is an requirement that comes across all pages -- thinking of making it more generic and Im trying this... "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]> wrote:Jacob, Why are you doing this in JavaScript to begin with? Why don't you use the struts html tags to display the select boxes and populate the options lists from collections. You can then set attributes in your form bean and have these fields be defaulted automatically. -Richard -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 4:06 PM To: [EMAIL PROTECTED] Subject: Javascript question... Hi Folks... One more javascript question... I have a page that consists of date fields as select boxes... say optionDay, optionMonth, optionYear... I fill the selectboxes calling a javascript function... Now if I have values of day, month, year executing an action. How can I default those values in the select box??? I mean how can I make that particular option 'selected'??? I know we can do that by calling a funtion on the load event... But, I don't want to do it that way as my body tag is generic across all pages... I am trying something like this... function generateYear(optionName,defaultValue) { var s = document.forms[0].elements[optionName]; var today = new Date(); var year = today.getYear(); document.write(''); document.write('Year'); for (var i=(year-4);i document.write('' + i+''); } document.write(''); } function generateDay(optionName,defaultValue){ document.write(''); document.write('Day'); for (var i=1;i document.write('' + i+''); } document.write(''); } function generateMonth(optionName,defaultValue){ document.write(''); document.write('Mon'); document.write('Jan'); document.write('Feb'); document.write('Mar'); document.write('Apr'); document.write('May'); document.write('Jun'); document.write('Jul'); document.write('Aug'); document.write('Sep'); document.write('Oct'); document.write('Nov'); document.write('Dec'); document.write(''); } and in my html... I say generateMonth("optStartDtMonth",12); generateDay("optStartDtDay",05); generateYear("optStartDtYear",2000); I want to make 12, 05, 2000 selected on the load of the page... how do I do that??? I am trying doing something like this... var s = document.forms[0].elements[optionName]; if ( s.options[i].value == defaultValue) { s.options[i].selected = true; } On the click of some thing it works -- if I put the code in the generate year or month or day, if fails to recognize the form element!!! Any suggestions appreciated... Thanks in advance... -Jacob - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Javascript question...
Richard... I find this list to be more user friendly in terms of responding to questions... Also, not that I do not use Struts at all... for this particular requirement of an old project under maintenance, I am trying to do this... I consider this to be very much knowledge sharing list and hence post questions whenever I have any... thanks is advance... Now, getting back to your question... this is the code... function generateYear(optionName,defaultValue) { var today = new Date(); var year = today.getYear(); document.write(''); }