I'm trying to get a "Save As" Dialog box to appear when a user changes the option of a select tag. I've looked all over the place, but can't seem to find a way to achieve this. Has anyone done this using javascript?
Save as dialog box?
Collapse
X
-
You can use
It will ask you 'OK' or 'Cancel'.Code:confirm("Do you want to save record?")
Thanks and regards,
VikasComment
-
I can see where you're coming from, but a confirm is not the same as a "Save as..." dialog, though it could be used if you're saving on the server.Originally posted by vikas251074You can use
It will ask you 'OK' or 'Cancel'.Code:confirm("Do you want to save record?")Comment
-
Ok, maybe I don't need a save as.
I have a selection box setup something like this......
[code=html]
<select name="competenc y" id="competency " onChange="downl oad_comp(this); return false;">
<option selected="selec ted">Select a Competency</option>
<option value="..\test\ test.log">Manag ement</option>
<option value="..\test\ test1.log">Nurs ing</option>
<option value="..\test\ test2.log">Staf f</option>
</select>
[/code]
When the user changes the option in this list, I want the file in the value field to be downloaded to their computer.Comment
-
How come I have to have the path to my file in the value field, and I can't pass it to a function as an argument?
I've got this code setup and it's working properly.
[code=javascript]
function download_comp(c omp){
var answer = confirm("Would you like to download the selected competency?")
if(answer){
competency = comp.value
oIfrm=document. getElementById( 'myIFrm')
oIfrm.src=compe tency
alert("Please remember to save the downloaded file to your local machine. Thanks!")
}
}
[/code]
[code=html]
<div>
<div align="center">
<select name="competenc y" id="competency " onChange="downl oad_comp(this); return false;">
<option selected="selec ted">Select a Competency</option>
<option value="..\test\ test.log">Manag ement</option>
<option value="..\test\ test1.log">Nurs ing</option>
<option value="..\test\ test2.log">Staf f</option>
</select>
</div>
</div>
[/code]
When I try to pass the path to download as an argument, I use alert to see what the value looks like and the path is all jumbled looking, not sure why it's doing that, but I'm assuming I need to convert the path or something, any ideas?
[code=javascript]
function download_perf(p erf){
// performance = perf.value
alert(perf)
ifrm=document.g etElementById(' myIFrm_perf')
ifrm.src=perf
alert("Please save the downloaded file to your local machine. Thanks!")
alert(ifrm.src)
}
[/code]
[code=html]
<td align="center"> <input type="radio" name="overall_p erf" id="radio93" value="1" OnClick="downlo ad_perf('..\\te st\testing.xls' );return false;"/></td>
[/code]Comment
Comment