RE: Javascript question...
Try this simple... document.write('select NAME='+optionName+''); document.write('option value=yearYear/option'); for (var i=(year-4);i(year+4);i++ ) { document.write('option value=' + i +'' + i+'/option'); if(i==defaultValue) { document.write('option value=' + i + ' selected' + i + '/option'); } } document.write('/select'); -Ram -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 9:04 PM To: Struts Users Mailing List Subject: RE: Javascript question... Oh... thanks buddy... I actually created an option object and finished this... After you saying I checked and yes how stupid I am !!! simple mistakes need an other eye... Thanks again... I did something like this -- this works fine too... var s = document.forms[0]; function generateYear(optionName,defaultValue) { var today = new Date(); var year = today.getYear(); document.write('select NAME='+optionName+''); document.write('option value=yearYear/option'); for (var i=(year-4);i(year+4);i++ ) { if(defaultValue == i) { yearOption = new Option(); yearOption.text= i; yearOption.value= i; s.elements[optionName].options[s.elements[optionName].options.length]=yearOption; yearOption.selected = true; } else { document.write('option value='+i+''+i+'/option'); } } document.write('/select'); } Joe Krause [EMAIL PROTECTED] wrote: You need to put a space in front of the word selected. Right now your HTML output will contain: 2005 This makes the value equal to 2005selected. By putting a space in between the quote and the word selected - you will change the value to 2005 and selected will be picked up correctly. document.write('' + i + ''); You should put double quotes around the value parameter - its cleaner HTML: document.write('' + i + ''); You might have to escape those - I'm not sure. -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 5:00 PM To: Struts Users Mailing List Subject: 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(''); document.write('Year'); for (var i=(year-4);i if(defaultValue == i) { document.write('' + i+''); } else { document.write('' + i+''); } } document.write(''); } generateYear(optStartDtYear,2005); My idea is to make '2005' selected when the page loads... The above code fails to make '2005' selected!!! If you can make me know the reason, it'd be great... Thanks! Yee, Richard K,,DMDCWEST wrote: 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 - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - 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...
Jacob, Have you considered using/writing a JSP custom tag to display the select boxes and select an item for you? That way the page may still work if JavaScript is turned off on the browser. -Richard -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 5:00 PM To: Struts Users Mailing List Subject: 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... script language=javascript function generateYear(optionName,defaultValue) { var today = new Date(); var year = today.getYear(); document.write('select NAME='+optionName+''); document.write('option value=yearYear/option'); for (var i=(year-4);i(year+4);i++ ) { if(defaultValue == i) { document.write('option value=' + i +'selected' + i+'/option'); } else { document.write('option value=' + i +'' + i+'/option'); } } document.write('/select'); } html script language=javascript generateYear(optStartDtYear,2005); /script /html My idea is to make '2005' selected when the page loads... The above code fails to make '2005' selected!!! If you can make me know the reason, it'd be great... Thanks! Yee, Richard K,,DMDCWEST [EMAIL PROTECTED] wrote: 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 - 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...
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... script language=javascript function generateYear(optionName,defaultValue) { var s = document.forms[0].elements[optionName]; var today = new Date(); var year = today.getYear(); document.write('select NAME='+optionName+''); document.write('option value=yearYear/option'); for (var i=(year-4);i(year+4);i++ ) { document.write('option value=' + i +'' + i+'/option'); } document.write('/select'); } function generateDay(optionName,defaultValue){ document.write('select NAME='+optionName+''); document.write('option value=dayDay/option'); for (var i=1;i=31;i++ ) { document.write('option value=' + i +'' + i+'/option'); } document.write('/select'); } function generateMonth(optionName,defaultValue){ document.write('select NAME='+optionName+''); document.write('option value=monthMon/option'); document.write('option value=01Jan/option'); document.write('option value=02Feb/option'); document.write('option value=03Mar/option'); document.write('option value=04Apr/option'); document.write('option value=05May/option'); document.write('option value=06Jun/option'); document.write('option value=07Jul/option'); document.write('option value=08Aug/option'); document.write('option value=09Sep/option'); document.write('option value=10Oct/option'); document.write('option value=11Nov/option'); document.write('option value=12Dec/option'); document.write('/select'); } /script and in my html... I say script language=javascript generateMonth(optStartDtMonth,12); generateDay(optStartDtDay,05); generateYear(optStartDtYear,2000); /script 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... script language=javascript function generateYear(optionName,defaultValue) { var today = new Date(); var year = today.getYear(); document.write('select NAME='+optionName+''); document.write('option value=yearYear/option'); for (var i=(year-4);i(year+4);i++ ) { if(defaultValue == i) { document.write('option value=' + i +'selected' + i+'/option'); } else { document.write('option value=' + i +'' + i+'/option'); } } document.write('/select'); } html script language=javascript generateYear(optStartDtYear,2005); /script /html My idea is to make '2005' selected when the page loads... The above code fails to make '2005' selected!!! If you can make me know the reason, it'd be great... Thanks! Yee, Richard K,,DMDCWEST [EMAIL PROTECTED] wrote: 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 - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
RE: Javascript question...
You need to put a space in front of the word selected. Right now your HTML output will contain: option value=2005selected2005/option This makes the value equal to 2005selected. By putting a space in between the quote and the word selected - you will change the value to 2005 and selected will be picked up correctly. document.write('option value=' + i + ' selected' + i + '/option'); You should put double quotes around the value parameter - its cleaner HTML: document.write('option value=' + i + ' selected' + i + '/option'); You might have to escape those - I'm not sure. -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 5:00 PM To: Struts Users Mailing List Subject: 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... script language=javascript function generateYear(optionName,defaultValue) { var today = new Date(); var year = today.getYear(); document.write('select NAME='+optionName+''); document.write('option value=yearYear/option'); for (var i=(year-4);i(year+4);i++ ) { if(defaultValue == i) { document.write('option value=' + i +'selected' + i+'/option'); } else { document.write('option value=' + i +'' + i+'/option'); } } document.write('/select'); } html script language=javascript generateYear(optStartDtYear,2005); /script /html My idea is to make '2005' selected when the page loads... The above code fails to make '2005' selected!!! If you can make me know the reason, it'd be great... Thanks! Yee, Richard K,,DMDCWEST [EMAIL PROTECTED] wrote: 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 - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
RE: Javascript question...
Oh... thanks buddy... I actually created an option object and finished this... After you saying I checked and yes how stupid I am !!! simple mistakes need an other eye... Thanks again... I did something like this -- this works fine too... var s = document.forms[0]; function generateYear(optionName,defaultValue) { var today = new Date(); var year = today.getYear(); document.write('select NAME='+optionName+''); document.write('option value=yearYear/option'); for (var i=(year-4);i(year+4);i++ ) { if(defaultValue == i) { yearOption = new Option(); yearOption.text= i; yearOption.value= i; s.elements[optionName].options[s.elements[optionName].options.length]=yearOption; yearOption.selected = true; } else { document.write('option value='+i+''+i+'/option'); } } document.write('/select'); } Joe Krause [EMAIL PROTECTED] wrote: You need to put a space in front of the word selected. Right now your HTML output will contain: 2005 This makes the value equal to 2005selected. By putting a space in between the quote and the word selected - you will change the value to 2005 and selected will be picked up correctly. document.write('' + i + ''); You should put double quotes around the value parameter - its cleaner HTML: document.write('' + i + ''); You might have to escape those - I'm not sure. -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 5:00 PM To: Struts Users Mailing List Subject: 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(''); document.write('Year'); for (var i=(year-4);i if(defaultValue == i) { document.write('' + i+''); } else { document.write('' + i+''); } } document.write(''); } generateYear(optStartDtYear,2005); My idea is to make '2005' selected when the page loads... The above code fails to make '2005' selected!!! If you can make me know the reason, it'd be great... Thanks! Yee, Richard K,,DMDCWEST wrote: 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 - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
RE: [OT] RE: javascript question...
I'm pretty sure you can do it: var newwin=window.open(a.html?Name= + namVal); Paul -Original Message- From: James Childers [mailto:[EMAIL PROTECTED] Sent: 29 October 2003 21:41 To: Struts Users Mailing List Subject: [OT] RE: javascript question... No, you can't do it that way. But you could create an otherwise unused hidden form element in your parent document, set it with the value you want from within your JavaScript function, and then reference that value from the child window. -= J -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 3: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??? script function go() { var namVal = document.fm1.txtName.value; var newwin=window.open(a.html?Name=namVal); } /script form name=fm1 onSubmit=go() input type=text name=txtName input type=submit value=go /form 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] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: javascript question...
Try this script function go() { var namVal = document.fm1.txtName.value; var newwin=window.open(a.html?Name=+namVal); } /script 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??? script function go() { var namVal = document.fm1.txtName.value; var newwin=window.open(a.html?Name=namVal); } /script form name=fm1 onSubmit=go() input type=text name=txtName input type=submit value=go /form 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]
[OT] RE: javascript question...
No, you can't do it that way. But you could create an otherwise unused hidden form element in your parent document, set it with the value you want from within your JavaScript function, and then reference that value from the child window. -= J -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 3: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??? script function go() { var namVal = document.fm1.txtName.value; var newwin=window.open(a.html?Name=namVal); } /script form name=fm1 onSubmit=go() input type=text name=txtName input type=submit value=go /form 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...
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??? script function go() { var namVal = document.fm1.txtName.value; var newwin=window.open(a.html?Name=namVal); } /script form name=fm1 onSubmit=go() input type=text name=txtName input type=submit value=go /form 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: [OT] RE: javascript question...
You are right... We can reference it using the window opener event and get the value in the child window... But, my problem is that -- inorder to populate the child window I need to execute an action and fetch values from the backend using this value... Is there any other way to solve this??? James Childers [EMAIL PROTECTED] wrote: No, you can't do it that way. But you could create an otherwise unused hidden form element in your parent document, set it with the value you want from within your JavaScript function, and then reference that value from the child window. -= J -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 3: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]